views:

123

answers:

5

My multithreaded Java program crashes because it runs out of heap space and I don't think it should. Assuming the culprit is unintentional object retention, what's a good free tool to investigate what objects are being unintentionally retained?

My IDE is Eclipse.

+4  A: 

A tool like Eclipse MAT will help to find greedy memory pigs and has even a memory leak detector.

The memory profiler of Visual VM might also help if you need to go at a lower level.

Pascal Thivent
Eclipse MAT is a good help to find leaks.
Carles Barrobés
+3  A: 

Here's a list of open source tools you can look at: http://java-source.net/open-source/profilers . Of course, JMap and JConsole are also possible solutions.

Todd R
+1  A: 

Sun's VisualVM is free, but I am a big fan of JProfiler which is a commercial app, although you can get a 30 day trial.

Rulmeq
+3  A: 
Carl Rosenberger
A: 

I would start with tools that come with JDK, jconsole and jmap. There is good article about JVM monitoring on java.sun.com.

binary_runner