2
votes

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?

3

3 Answers

0
votes

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.

0
votes

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.