cc_staff
318
edits
No edit summary |
No edit summary |
||
Line 38: | Line 38: | ||
===Memory Issues=== <!--T:8--> | ===Memory Issues=== <!--T:8--> | ||
Java | The Java virtual machine expects to have access to all the physical memory on a given compute node, while the scheduler or a shell might impose its own memory limits (often different) according to the submission script specifications or limitations of the login node. In a shared computing environment, these limits ensure that finite resources, such as memory and CPU cores, do not get exhausted by one job at the expense of another. | ||
When the Java VM starts, it sets two memory parameters according to the amount of physical rather than available memory as follows: | |||
* Initial heap size of 1/64 of physical memory | |||
* Maximum heap size of 1/4 of physical memory | |||
These two parameters can be explicitly controlled on the command line by following either syntax below: | |||
java -Xms256m -Xmx4g -version | |||
or | |||
java -XX:InitialHeapSize=256m -XX:MaxHeapSize=4g -version | |||
On a system with a lot of physical memory, the 1/4 can easily exceed the memory limits imposed by a shell or by the scheduler, and Java will fail with messages like these | |||
Could not reserve enough space for object heap | |||
There is insufficient memory for the Java Runtime Environment to continue. | |||
You can see all the command line options the JVM is going to run with by specifying the following flag <code>-XX:+PrintCommandLineFlags</code>, like so: | |||
<pre> | |||
$ java -Xms256m -Xmx4g -XX:+PrintCommandLineFlags -version | |||
-XX:InitialHeapSize=268435456 -XX:MaxHeapSize=4294967296 -XX:ParallelGCThreads=4 -XX:+PrintCommandLineFlags -XX:+UseCompressedOops -XX:+UseParallelGC | |||
</pre> | |||
<!--T:9--> | <!--T:9--> |