Problem
Compiling a Java application or applet will fail with:
Warning: Not enough memory for the JIT compilerand/or:[java.lang.VerifyError: (class: <your_class>, method: <some_method>, signature: (<list of java Libraries>; ) Out of Memory]
The Java error message will vary based on what classes and libraries the Just In Time (JIT) compiler is trying to access.
Cause
There may be many causes for this error, but the fundamental cause for this is memory, either virtual or physical.
There may not be enough memory on the system to successfully
compile the classes. Also, there may be a lack of swap space
on the system. Adding swap space is the first thing to try. Solution
First, figure out how much swap is on the system:
# swap -l
path dev swaplo blocks free
/dev/swap 1,41 0 100000 68952This will tell you how much swap space is available on the system, in 512-byte blocks. Depending on how much RAM you have on the system, the swap space needed will be around 1.5 times the size of the memory on the system, in most cases.
If there is a lack of swap space on the system, you will need to add more to the system. You do not need to reformat your drive to reorganize your filesystem slices. You may create a file and add it as swap space:
# touch /swap1You will then need to specify how many bytes will be available for
swap:# swap -a /swap1 50000This will add 50000 bytes to the swap space.
# swap -l
path dev swaplo blocks free
/dev/swap 1,41 0 100000 68952
/swap1 76,1 0 50000 50000If the sum of the free space is 1.5*RAM, the JIT compiler should work.
If it does not work, the amount of physical RAM may need to be increased. More swap space will be needed for this as well.
NOTES: See Java system requirements for memory specifications. See also
ta105153, "How can I increase swap space without reconfiguring existing divisions?"