I know that my program invokes the gc in regular intelvals, but I would like to analyse only the generated garbage. I want to know which classes are most frequently abandoned, and much more important, where are those instances created. Generally I want to optimize for escape analysis to reduce the garbage collection to a minimum.
Edit: I am not interested in live objects.
JProfiler gives you statistics about garbage collected objects. The allocation tree and hot spots even show you where they have been created.
In the "Recorded objects" view, change the "Liveness mode" to "Garbage collected objects":
Disclaimer: My company develops JProfiler.