9

I know that the JVM can do some pretty serious optimizations at runtime, especially in -server mode. Of course, it takes a little while for the JVM to settle down and reach peak performance. Is there any way to take a snapshot of those optimizations so they can be applied immediately the next time you run your app?

"Hey JVM! Great job optimizing my code. Could you write that down for me for later?"

Dave Ray
  • 39,616
  • 7
  • 83
  • 82
  • I believe IBM have a new JRE that does that. – Tom Hawtin - tackline Dec 17 '08 at 14:41
  • Indeed. See my answer in: http://stackoverflow.com/questions/11652499/just-in-time-compilation-storing-vs-doing-always/11661833#11661833 for duplicate question: http://stackoverflow.com/questions/11652499/just-in-time-compilation-storing-vs-doing-always – Trent Gray-Donald Jul 31 '12 at 03:11

2 Answers2

3

Basically not yet with Sun's VM, but they have it in mind.

See various postings/comments under here:

http://blogs.oracle.com/fatcatair/category/Java

(Sorry: I can't find quite the right one about retaining stats over restart for immediate C1 compilation of known-hot-at-startup methods.)

But I don't know where all this stuff is right now.

Note that optimisations appropriate in steady-state may well not be appropriate at start-up and might indeed reduce start-up performance, and indeed two runs may not have the same hotspots...

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
0

Perhaps this might help: http://wikis.sun.com/display/HotSpotInternals/PrintAssembly.

Bala
  • 979
  • 1
  • 10
  • 21