• 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

Tomcat memory leak identification

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have been using Netbeans profiler to profile my remotely running application .
All i get is a lot of native classes using up memory (Please see attachment).

How can i drill down from there to know the root cause of the memory leak.
My code is locally on my system but i am profiling a application running on a remote system.

Can anyone give me a nice hint of proceeding further.
profiling-netbeans2.png
[Thumbnail for profiling-netbeans2.png]
My screenshot
 
Ranch Hand
Posts: 443
3
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First how do you know you have a leak out of memory, which GC are you using ?

The simplest trick is to run do a jmap at the start when you think its stable then when you think memory has risen jmap again and compare the difference.
Jmap and visualVM (very similar to NetBeans I believe same code base) are supplied free in the Java JDK.

As a quicky download Eclipse MAT (free) and run a leak report on one of your hprofs you think shows the leak to see if that tells you anything.

Your right in that looking at the base Java classes is usually pointless (except when I found a Java plugin bug lol) they are usually caused by something further down the list,... I would look down the list for the first of your classes or other lib you use even if seemingly small, from there with Eclipse Mat usually or Visual VM nearest GC root I work out what's the biggest consumer and then how/if they cause the bigger problems near the top. the other way you can tackle it is to use MAT to tell you what the biggest char [] consumer is etc but that's such a generic class that it can be hard to interpret the results. I usually have both Eclipse MAT and Visual VM on the job when fixing one of these.



 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Chris Hurst wrote:I usually have both Eclipse MAT and Visual VM on the job when fixing one of these.



You could also try bheapsampler ( http://www.dr-brenschede.de/bheapsampler/ )

It's powerfull especially for just showing the problem without the need for an "eduacted searching procedure".
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic