Java.lang.OutOfMemoryError
Subscribe

From OpenNMS

Jump to: navigation, search

Garbage collection and heap allocation have changed somewhat in java 5. There are some useful notes on Sun's website under Garbage Collection Ergonomics and Server Class Machine Detection.

PermGen Space

Some parts of OpenNMS exercise the JDK in interesting ways, and sometimes you can get the error:

 java.lang.OutOfMemoryError: PermGen space

The default (64MB) is enough for many uses, but code that uses a lot of custom class loaders or java primitives in a short amount of time can overstep these bounds. To fix it, increase your maximum PermGen space by editing $OPENNMS_HOME/etc/opennms.conf (create the file if it doesn't exist) and adding the line:

 ADDITIONAL_MANAGER_OPTIONS=-XX:MaxPermSize=128m

128 might be enough, but if you still run into issues, feel free to bump it higher.

Other Out of Memory Errors

If you get a java.lang.OutOfMemoryError error that doesn't involve PermGen space, you may just need to increase the java heap size allotted to OpenNMS. By default, OpenNMS used 256MB. To do this, add this line to $OPENNMS_HOME/etc/opennms.conf:

 JAVA_HEAP_SIZE=512

You may need to experiment with how much memory to give OpenNMS.