• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tool for finding Memory Leaks in Java (experiencing OutOfMemoryErrors in 3rd party library)

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been searching for a tool to find the root cause of a memory leak. Stumbled upon http://plumbr.eu/ - has anybody used it? Any experiences? Alternatives?
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Manivo Edwards wrote:Alternatives?


Profiling, code reviews, and testing (cube the latter).

Winston
 
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Personally, I like JConsole, Mainly because it's installed with Java, so I know it;s going to be available in any environment

Plumr looks cool. Although, I don't know whether it will work in all cases. For example, if I have a pool of objects, and the normal operation is that the pool grows and reduces as the load on my server decreases and increases. An individual item in the pool is expected to stay in memory longer than it is required. Will plumr detect this as a memory leak? It is not a memory leak. Or what if I am putting too many objects in Session. Will plums detect it as a memory leak? One would say this may not be technically a leak, it is still a concern for high memory usage. How does it differentiate an object pool from a Session Pool
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, haven't used that, but I would recommend a plug-in for Eclipse called the Memory Analysis Tool. It has a functionality called the "memory leak suspects finder" which is smarter than me, I mean, very good.

By the way, this statement does not make sense: Getting OutOfMemoryErrors in a third-party library.

You run out of memory. At the point just before that, you are exactly at the limit -- all memory available to the JVM is in use and none can be freed up by garbage collection (slight simplification, please ignore). You can reach this limit in any place in your code, irrespective of where memory is being leaked. The OutOfMemoryError happens next time an object is created, for which some memory is needed. The place where you run out of memory does not tell you anything about the location of the problem. Really! Don't get thrown off by this. You need to understand which memory is not released, where you are expecting that it is. This is rarely an easy question to answer, unfortunately.

Cheers-
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I use jprofiler and can swear by it. Tool like jhat and analyzing VM specific dumps can also help you find the leak.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One other thing to do would be to take thread dump on the server and try analyzing the thread dump using various analyzing tools like - TDA Thread dump analyzer and IBM Thread dump analyzer. That would give us an idea of what were the processes running when the out of memory error occured.
reply
    Bookmark Topic Watch Topic
  • New Topic