Hi Jan, You can use the environment variable _JAVA_OPTIONS to set -Xmx.
The other option is to use your own wrapper script for launching the VM that contains whatever flags you need.
David Holmes On 17/11/2011 11:28 PM, Jan Just Keijser wrote:
hi all, I would like to report an issue with OpenJDK 1.6 (and Oracle Java 6u29) that we have run into on our grid computing farm: the latest&greatest worker nodes have 12 cores and 48 GB of RAM ; we offer a maximum 12 jobs slots on these worker nodes, in order to accomodate small and large jobs (users can requests 1 - 12 cores). To ensure that the different jobs don't interfere with each other we also set a VMEM limit for each job slot. The current VMEM limit is 48 / 12 = 4 GB RAM per job slot. Each single core job that starts has a 'ulimit -v' of 4,000,000 . On these boxes OpenJDK 'java' refuses to start: $ java -version Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine. After some debugging I found that this is caused by the default maximum heap size which java allocates: it scans /proc/meminfo to extrac the amount of RAM installed and divides it by 4 ; an 'strace' shows that indeed 'java' tries to do an 'mmap' call for 12 GB of RAM ! A work around is to always specify '-Xmx2GB' or something similar but this does not work for all software that we use , plus , I find it annoying that I have to tell this to all my users. What I would like to see is a system-wide setting for the initial maximum heap size, so that java -version "just works" . Is this possible? thanks in advance, JJK / Jan Just Keijser