Paths of Objects without GC roots

Questions about YourKit Java Profiler
Post Reply
Posts: 7
Joined: Mon Apr 24, 2023 9:29 am

Paths of Objects without GC roots

Post by ron.amir »

Hello, I can see that a certain object is created excessively during a request, however when I capture a memory snapshot at the end of the request and before GC, I see that those object don't have a gc root, i.e. they will be collected by the next gc. Is there a way for me to understand the path to this object even though it doesn't have a root at the end of the request? some way to understand where this object is being created?

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

Re: Paths of Objects without GC roots

Post by Vladimir Kondratyev »

1) Start object allocation recording, make requests and capture memory snapshot ... ording.jsp

2) Open snapshot and select "reachability" view ... ity.jsp#ui

3) Select "Objects pending finalization" row and press F4

4) Select "Allocation call tree - All threads merged" ... merged.jsp

You will see where the objects pending finalization have been allocated.

Best regards,
Vladimir Kondratyev
YourKit GmbH
"Don't get lost in data, get information!"
Post Reply