How can I capture a Core Dump and analyze the Java heap on an application running in Apache Tomcat?
-
possible duplicate of [How to get a thread and heap dump of a Java process on Windows that's not running in a console](http://stackoverflow.com/questions/407612/how-to-get-a-thread-and-heap-dump-of-a-java-process-on-windows-thats-not-runnin) – flup Nov 28 '13 at 06:52
2 Answers
A javacore can be provoked manually (assuming the JVM is configured to dump at user signal - generally it is).
- On Windows: Press ControlBreak on the command window to generate the dumps.
- On Linux: Press Control\ on the shell window.
- On *nix or using Cygwin:
kill -quit <pid>
All in all, launch Tomcat from a console, then depending on your platform perform one of the options above. This will generate a javacore which can be analyze with various tools e.g. Visual VM, etc.

- 11,622
- 7
- 51
- 61
VisualVM
provide wide range of memory test on any application running with Java. I don't have much idea about tomcat memory analyzer but I'd prefer VisualVM
Download: https://visualvm.java.net/
VisualVM is a visual tool integrating several commandline JDK tools and lightweight profiling capabilities. Designed for both production and development time use, it further enhances the capability of monitoring and performance analysis for the Java SE platform
Screenshot of heap dump.

- 3,847
- 7
- 42
- 67
-
1That is a plot of the heap size, not a heap dump. VisualVM can produce those too, but on the profiler tab. – flup Nov 28 '13 at 06:48
-
Oh sorry I don't know about that. But As I said it provides wide range of options – Vicky Thakor Nov 28 '13 at 06:49