Please, is there any way how to get history of objects (their variable or at least class names) that have been garbage collected in Java?
Just adding these params (to Oracle JVM)
-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps
doesn’t provide anything else memory in bytes. It’s very limited help to me. Thanks for all responses.
Note: Workaround with add finilize() method is not unfortunatelly an option for me (I don’t have an access to it).
Disclaimer: My company develops the tool that I recommend in this answer.
In JProfiler you can go to the “Recorded objects” view in the memory section and switch the liveness mode to garbage collected objects (View->Change Liveness Mode->Garbage Collected Objects). You will then see a statistics of objects that have been GCed.