views:

121

answers:

1

Is there any difference between Java Memory Analysis Tools (profilers like Yourkit Java Profiler) and Java Memory Leak Detection Tools? (From my searches, the difference is pretty hard to notice in what tools are concerned, but it sounds to me like a difference in the approach manner). If there is, are there any free (available for download) tools for memory leak detection (not memory profiling)? Thank you in advance!

+1  A: 

Think of Memory Leak Detection Tools as just an optimized version of a memory analysis tool that helps you find a problem without having to go scouring through the data yourself.

I've used Yourkit. I would argue it has both features. While it doesn't explicitly point out "yo dude, your leak is on this line of code" it provides utility for comparing snapshots of memory to show what changed over time and provides various utilities for chasing the references of objects to figure out why they are still being held in memory.

Depending on your definition of leak detection tools, one could argue that the graph in JConsole that shows heap memory usage is a leak detection tool. Look at a graph of heap consumption over a long enough period of usage...if the average value keeps going up, good chance you have a leak.

I'm not related to the Yourkit folks, but I can recommend the tool. It could be better, but it isn't bad. I use it for both memory and cpu performance analysis. I do regular load and memory testing (JConsole/JMX and other methods) on our product and use Yourkit when something seems odd. About once every 2-4 months I do a cpu analysis looking for easy to fix performance bottlenecks (our load testing catches major problems).

Jim Rush