• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

How to find memory leaks in a Tomcat servlet?

 
Ranch Hand
Posts: 334
2
Netbeans IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 334
2
Netbeans IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Bill.

I'll check that out tomorrow.

Joe
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic