Search code examples
jprofiler

JProfiler "Recorded Objects" shows different results with/without System.gc even though session settings say to record "Live and GCed objects"


My session settings tell JProfiler to record "Live an GCed objects". I configured the session to start recording "Allocation data" at VM startup. Recording is stopped at VM exit.

When I run my test, "Recorded Objects" shows about 8 mio allocations, 500MB in size. If I add a System.gc() at the end of the test, the "Recorded Objects" drop to 800k allocations, 135MB in size.

Why's that so? I assumed to see the whole object throughput in "Recorded Objects" if I tell JProfiler to record GCed objects as well.


Solution

  • Switch the "Liveness mode" to "Live and garbage collected objects":

    enter image description here