PermGen Out of Memory

See the INSTALL file bundled in the latest Mifos release zip file for recommended JVM memory settings.


java.lang.OutOfMemoryError: PermGen space errors in the logs. This error indicates that available permanent generation space has been exhausted by application(s) running in the JVM, by Strings and other immutable objects.

The current thinking on the issue is just that the default allocation of 64MB is too small (see http://alessandroribeiro.com/?q=en/node/33 for the reasoning behind this)

We have increased the allocation to PermGen space in the JVM to min 128Mb and max of 256Mb and have no longer seen any issues on the test server.

To resolve the issue in your local installation of Mifos, you can specify the amount of memory allocated to the PermGen when starting your application server:

There are two command-line parameters that you must use to define the size of the permgen area:

-XX:PermSize -XX:MaxPermSize

For example:

java -Xmx512m -XX:MaxPermSize=256m

Jetty Server

You can specify JVM parameters in JETTY_HOME/bin/jetty.sh and JETTY_HOME/start.ini

Modify your start.ini file and add this:

--exec
-Xmx512m 
-XX:MaxPermSize=256m

Add this in your jetty.sh just after the comments (#) section, around line number 80:

export JAVA_OPTIONS="-Xmx512m -XX:MaxPermSize=265m"

You can start Jetty using jetty.sh or start.jar

Read more about Jetty configuration here.

http://wiki.eclipse.org/Jetty/Howto/Run_Jetty

http://wiki.eclipse.org/Jetty/Feature/Start.jar

See also