Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Analyze Tomcat Heap in detail on a production System

Having analyzed a light-load web application running in tomcat, using JMX Console, it turns out the "PS Old Gen" is growing slowly but constant. It starts with 200MB and grows around 80MB/Hour.

CPU is not an issue, it runs at 0-1% on average, but somewhere it leaks memory, so it will become unstable some days after deployment.

How do i find out what objects are allocated on the heap? Are there any good tutorials or tools you know?

like image 546
Andreas Petersson Avatar asked Dec 16 '08 14:12

Andreas Petersson


1 Answers

You could try jmap, one of the JDK Development Tools. You can use jhat with the output to walk heap dumps using your web browser.

See this answer for a short explanation.

This comes up quite often, so searching SO for those tools should turn up some alternatives.

like image 177
McDowell Avatar answered Sep 28 '22 05:09

McDowell