views:

156

answers:

2

I have a JAVA process that runs every day and takes about 1,000 or 2,000 hits before it is fully optimized by the JIT. What I'd like to do is save the JIT info so that the next day it can start in an optimized state. It seems like this should be possible, but I have not been able to find any method for doing so.

+2  A: 

You could use an ahead-of-time compiler like JET or GCJ, but I don't believe there's any standard way to save the JIT form. Keep in mind that this ties your program into the architecture you're running on, but it sounds like you're aware and accepting of this.

Jon
Some more info from http://www.javalobby.org/forums/thread.jspa?threadID=15812: Apparently the current research shows that loading the cached JIT is slower than recompiling it in most cases, but that you may want to give JRockit a try.
Jon
that thread is 6 years old - i'm not sure it qualifies as "current" research" :)
Peter Recore
You make an excellent point that I should have noticed (or checked). I'm still just reeling from that Bush-Kerry race.
Jon
on the other hand, it is possible the research hasn't changed at all since then! processors are still a lot faster than disks (if anything, they are even more faster than disks than they were before, unless you are lucky enough to be running a solid state disk in your servers.)
Peter Recore
A: 

Can you just keep your app running? What happens if you just have your app sleep until the next day rather than shutting down? You will then save time starting up the JVM as well as potentially skipping the jitting phase.

Peter Recore
this is attractive, but i don't have that level of control over the enterprise decisions.
Zip
doh! I feel your frustration.
Peter Recore