I have the following problem:
$ java -jar program.jar
Error occurred during initialization of VM
Could not reserve enough space for code cache
The amount of memory that is seen by the system seems sufficient:
$ free -m
total used free shared buffers cached
Mem: 5959 640 5318 0 0 390
-/+ buffers/cache: 249 5710
Swap: 4099 0 4099
I tried lowering heap settings as low as 16mb, but it didn't help:
$ java -Xmx16m -Xms16m -jar program.jar
Error occurred during initialization of VM
Could not reserve enough space for code cache
What can be wrong? How can I debug this?
EDIT: Forgot to include version - I use Sun Java 7u15, 64 bit. I actually can't get it to display a version string, because "java -version" fails with the same error.
Also, for some reason, if I use OpenJDK 6u27, it starts up - but since the app expects java 7, it doesn't work.
Seems that my java was running on Gentoo Hardened Linux, and kernel had PaX enabled. To disable pax memory control, I used the following command:
paxctl -c -m /path/to/your/java/bin/java
After that, everything was smooth.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With