All Collections
For Instructors
Assignment Setup
JVM - Insufficient Memory Error
JVM - Insufficient Memory Error
David avatar
Written by David
Updated over a week ago

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

This is due to a known Java bug when process-limiting the virtual memory via ulimit (

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

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

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

Did this answer your question?