Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to find memory leaks in a Tomcat servlet?

 
Joe Areeda
Ranch Hand
Posts: 331
2
Java Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 331
2
Java Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bill.

I'll check that out tomorrow.

Joe
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic