Useful java parameters

“Good” set of java parameters to run “generic” application like tomcat:

JAVA_OPTS=”-d64 -Xms512m -Xmx512m -XX:MaxPermSize=128m”
JAVA_OPTS=”-Djava.awt.headless=true -Djava.net.preferIPv4Stack=true $JAVA_OPTS”
JAVA_OPTS=”-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:-TraceClassUnloading $JAVA_OPTS”
JAVA_OPTS=”-XX:+HeapDumpOnOutOfMemoryError -XX:+HeapDumpOnCtrlBreak -XX:HeapDumpPath=/home/tomcat/snapshots $JAVA_OPTS”

These are not good but they are working options to enable jmxremote console.

JAVA_OPTS=”-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=1888 -Djava.rmi.server.hostname=test.comĀ  $JAVA_OPTS”
To exit on OutOfMemoryError in jdk1.6:

Unix:
-XX:OnOutOfMemoryError="kill -9 %p"

Windows:
-XX:OnOutOfMemoryError="taskkill /F /PID %p"

JRockIT:
-XXexitOnOutOfMemory

This entry was posted in java and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>