aspose file tools*
The moose likes Tomcat and the fly likes How to find memory leaks in a Tomcat servlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to find memory leaks in a Tomcat servlet?" Watch "How to find memory leaks in a Tomcat servlet?" New topic
Author

How to find memory leaks in a Tomcat servlet?

Joe Areeda
Ranch Hand

Joined: Apr 15, 2011
Posts: 318
    
    2

I'm fairly new to creating Servlets so I'd bet the answer to this is well know but I can't seem to generate the proper search to find the answer.

My prototype is starting to actually do some useful work although I'm still at the point where my to do list is about the same size as the code base. It's a good research process to see which is growing faster.

When I stop or redeploy the next version and do a Find Leaks I get the message:



I'm developing in NetBeans. Running the NB profiler does suggest that I'm leaving classes loaded.

#1 Is there an easy way to figure out which classes are still loaded?

#2 Perhaps, I just haven't learned the proper way to exit a servlet. Any suggested reading for me?

Thanks, I really appreciate the help I've gotten from the Ranch.

Joe


It's not what your program can do, it's what your users do with the program.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12782
    
    5
I suspect it is NetBeans and the undeploy-reload cycle causing the problem.

If you run Tomcat directly - for example as an application using startup.bat - and shut it down with shutdown.bat - the JVM completely exits leaving nothing in memory so this development problem will not affect a production system.

Bill

Joe Areeda
Ranch Hand

Joined: Apr 15, 2011
Posts: 318
    
    2

Thanks Bill.

I'll check that out tomorrow.

Joe
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to find memory leaks in a Tomcat servlet?