JVM - Insufficient Memory Error

If you are getting out-of-memory errors when compiling or running java programs for small programs -- 

# There is insufficient memory for the Java Runtime Environment to continue. 
# Native memory allocation (malloc) failed to allocate 339376 bytes for Chunk::new <br>

This is due to a known Java bug when process-limiting the virtual memory via ulimit (https://bugs.openjdk.java.net/browse/JDK-8071445).

To resolve this, please set the max heap limits to a reasonable value.

    javac: add the option "-J-Xmx<limit>" (eg. -J-Xmx256m) to your command
    java:  add the option "-Xmx<limit>" (eg. -Xmx256m) to your command <br> 

Alternately, you may increase the memory in the Course Settings - 

Still need help? Contact Us Contact Us