What do the Android Studio HPROF reference tree element colours represent?

前端 未结 2 1340
[愿得一人]
[愿得一人] 2021-02-05 09:13

Can someone tell me what does bold, blue one and red one positions in HPROF Viewer in Android Studio means exactly ?

I ask about one in Reference Tree panel.

2条回答
  •  独厮守ぢ
    2021-02-05 09:41

    I can't find any documentation on this, but from looking through a few heap dumps this is what they seem to be:

    • blue - The closest dominator of the instance selected in the top-right pane.
    • bold - A GC root, eg an instance with depth 0 that should not be collected. This answer has more information on what a GC root is, and this answer lists the types of things that are roots.
    • red - I haven't actually seen these, but I would guess it indicates an instance that should be garbage collected, but hasn't been yet.

    Again, a disclaimer here is that this could all be wrong and I can't actually find any official information about this, but it does seem to match up with my observations when using the heap profiler.

提交回复
热议问题