Profiling OpenKM

From OpenKM Documentation
Revision as of 09:28, 20 September 2012 by Pavila (talk | contribs) (Created page with ' <source lang="bash"> CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote=true" CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote.port=9090" CATALINA_OPTS="$C…')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote=true"
CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote.port=9090"
CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote.ssl=false"
CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
#CATALINA_OPTS="$CATALINA_OPTS -Djava.rmi.server.hostname=localhost"

HPROF

Java includes HPROF, a profiler which collect application runtime information. HPROF is capable of presenting CPU usage, heap allocation statistics, and monitor contention profiles.

For example, can collect CPU usage information by sampling threads. Add this line to $TOMCAT_HOME/bin/setenv.sh file:

JAVA_OPTS="$JAVA_OPTS -agentlib:hprof=cpu=samples"

When Tomcat starts you can see a file called java.hprof.txt. The CPU profiling info will be dumped to this file once Tomcat process is stopped.

More info:

More info

There are some other interesting tools for debugging and profiling a Java application: