Reachability: objects pending finalization retained also as strongly referenced

Questions about YourKit Java Profiler
Post Reply
alostale
Posts: 1
Joined: Mon May 08, 2023 12:41 pm

Reachability: objects pending finalization retained also as strongly referenced

Post by alostale »

Hi,

Checking the Memory > Reachability view it looks like "Objects pending finalization" are also counted as retained via strong references.

Is this behavior correct? If so, what is the explanation?

For example I get this:

Image

See the retained size where strong references is 95% and objects pending finalization is 94%.

This memory dump was taken executing this test, after objects creating before invoking garbage collection.

Thanks,

Asier
Vladimir Kondratyev
Posts: 1624
Joined: Tue Aug 10, 2004 7:52 pm

Re: Reachability: objects pending finalization retained also as strongly referenced

Post by Vladimir Kondratyev »

This behavior is intentional and correct: object can be resurrected and become strongly reachable after invoking .finalize().

Best regards,
Vladimir Kondratyev
YourKit GmbH
http://www.yourkit.com
"Don't get lost in data, get information!"
Post Reply