Can I use JConsole to find out which class eats up all the memory?

I am developing a JAVA web application now(using Tomcat 4.1.31), the problem is my web application will crash after running for several days -- The http request cannot be handled and the exception is "out of memory". It seems that some classes in my application eats up all the memory.

I have read the article "Using JConsole to monitor applications" and I want to know: Can I use JConsole to find out which class in my web application eats up all the memory? If it does, how can I get started? And if JConsole cannot do that, how to debug my application to find out the memory-leak?

Thanks in advance.

[622 byte] By [Eric.Zhanga] at [2007-11-26 20:11:56]
# 1
Hi,You might want to look at jhat/jmap - in particular jmap -histo might help you.More info here: http://weblogs.java.net/blog/mandychung/archive/2006/12/java_se_6_monit.htmlCheers,-- danielJMX, SNMP, Java, etc... http://blogs.sun.com/jmxetc
dfuchsa at 2007-7-9 23:17:02 > top of Java-index,Core,Monitoring & Management...
# 2

Thanks, we will read your articles.

> Hi,

>

> You might want to look at jhat/jmap - in particular

> jmap -histo might help you.

> More info here:

> http://weblogs.java.net/blog/mandychung/archive/2006/1

> 2/java_se_6_monit.html

>

> Cheers,

> -- daniel

> JMX, SNMP, Java, etc...

> http://blogs.sun.com/jmxetc

Eric.Zhanga at 2007-7-9 23:17:02 > top of Java-index,Core,Monitoring & Management...