Monday, November 5, 2007

jvm parameters while doing j2ee development

When doing j2ee development you redeploy a lot of war/ear archives. When using standard jvm settings this will result in OutOfMemory condtions and the famous PermGen space Exception.

I use following parameters for my jvm:


-XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled
-XX:MaxPermSize=128m -Xms1024m -Xmx1024m -Dsun.rmi.dgc.client.gcInterval=3600000
-Dsun.rmi.dgc.server.gcInterval=3600000



See here for more information for a detailed explanation about some of these parameters ( especially for the Concurrent Mark Sweep garbage collector an permgen space issues.

You might want to set -Xms and -Xmx a little bit lower if you dont have that much ram available.