LinuxSupportFAQForm | |
---|---|
SupportProblem | On 64bit SLC4, SUN Java gives an error message about missing virtual memory |
SupportAnswer |
(Reminder: JAVA is not supported by CERN IT)
The full error message looks like:java -version Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine.This appears to be similar to http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6245770 (which is supposedly fixed in 1.5.0_07 but apparently isn't, since the issue is still present in 1.5.0_10). In other words, Java tries to grab a large chunk of virtual memory (1GB or so) on startup in case it later might want to do something useful with this. On shared machines such as LX64SLC4, limits on virtual memory usage prevent it from doing so. And Java then falls over. A wider discussion is at http://forum.java.sun.com/thread.jspa?threadID=651637 and http://forum.java.sun.com/thread.jspa?threadID=632411 Workarounds involve explicitly limiting memory usage from the command line, via combinations of parameters ( XX:ReservedCodeCacheSize , XX:InitialCodeCacheSize , Xms , Xmx )
For java , use one of
java -XX:ReservedCodeCacheSize=128m -XX:InitialCodeCacheSize=48m -version java -Xms64m -Xmx384m -versionFor javac , use something like
javac -J-Xmx32m -J-XX:ReservedCodeCacheSize=128mYou may have to experiment to find a useful comination that has allocates enough memory for you application to start, but little enough to actually suceed. (Reminder: JAVA is not supported by CERN IT) |
OsVersion | SLC4 |
HardwareArchitecture | x86_64 (Opteron/EM64T) |
ApprovedBySupport | SupportApproved |