views:

202

answers:

2

I'm working on a large application (300K LOC) that is causing a memory leak in the Sun 1.6 JVM (1.6_05). Profiling the Java shows no leak. Are there any diagnostics available from the JVM that might detect the cause of the leak?
I haven't been able to create a simple, isolated Java test case. Is the only way to figure this out by using a C heap analyzer on the JVM?
The application creates a pool of sockets and does a significant amount of network I/O.

+1  A: 

Some profiler like profiler4j can show the manged and the unmanged memory (live curve). Then you can see if you has a leak and when the leak occur. But you does not find more informations.

After this there are 2 possible solutions:

  1. You can with the live curve isolate the problem and create a simpler test until you have find the cause of the problem.
  2. You search your code for the typical problems like:
    1. Instances of the class Thread that are never start.
    2. Images or Graphics that never are dispose
    3. ODBC Bridge Objects that are never close
Horcrux7
A: 

I love valgrind (http://valgrind.org/) if you are executing it on a system it supports. It rocks.

Sam

Sam Reynolds