Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to save the JAVA JIT information for the next run so that i don't have to warm up the code every day?

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.

like image 621
Zip Avatar asked Feb 01 '10 17:02

Zip


People also ask

How many times does JIT compile in runtime?

The above loop code runs for 10 times if the value of i is 0. It is not necessary to compile the bytecode for 10 times again and again as the same instruction is going to execute for 10 times. In that case, it is necessary to compile that code only once and the value can be changed for the required number of times.

Is JIT faster than compiled?

A JIT compiler can be faster because the machine code is being generated on the exact machine that it will also execute on. This means that the JIT has the best possible information available to it to emit optimized code.

What is the advantage of compiling Java source code using a JIT?

Advantages of JIT compilation include: JIT compilers need less memory usage. JIT compilers run after a program starts. Code optimization can be done while the code is running.

Where is JIT compiled code stored?

To put it another way, it's a long-running, computer-intensive application that optimizes performance. It improves the performance of a Java application during compilation or execution. The JIT compiler is located inside the JVM.


1 Answers

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.

like image 93
Jon Avatar answered Oct 04 '22 19:10

Jon