views:

232

answers:

3

I have some Java code that is throwing out of memory exceptions after running for a while. I've investigated the netbeans profiler, and when I do one specific operation the Surviving Generations Metric goes up. However when I reset the program status (not kill it), the Surviving Generations Metric does not decrease.

Why is the surviving generations metric not decreasing?

+2  A: 

Have you looked at What Do The Surviving Generations Metrics Mean?

R. Kettelerij
A: 

Run it under 1.6, and use the Java VisualVM (jvisualvm).

Select your process, right click and choose Heap Dump.

Let it run a while and take another heap dump.

Then use File > Compare Memory Snapshots to compare the two dumps.

Devon_C_Miller
A: 

I have the same problem here, but only in the case I profile a JUnit test - surviving generations are growing linearly. When I run the same code in main method, the code behaves as expected.

blurec