JVM memory dump

170 views Asked by At

We have Tomcat 7 and Java 7 running our application.

The last days we got a lot of java.lang.OutOfMemoryError: PermGen space errors.

So I added to /usr/share/tomcat7/conf/tomcat7.conf in JAVA_OPTS:

# Use JAVA_OPTS to set java.library.path for libtcnative.so
JAVA_OPTS="[...] -XX:ErrorFile=/var/log/jvm_crash.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/ec2-user/dumps"

But /var/log/jvm_crash.log is empty and there are no *.hprof files anywhere (not only in /home/ec2-user/dumps, where I would expect them to be).

What did I miss here?

1

There are 1 answers

0
Rey Libutan On

Just a suggestion to solve your memory leak problem, you could use Java VisualVM. It should just be located at JDK_HOME/bin/jvisualvm.exe.

With this tool, one thing you could do is track what Object has the most number of instances and those objects that are still present in the memory even though not used anymore.

This video should help you get started.