質問

I am using Memory Analyzer to profile my program memory consumption. I have some big objects that i want to make eligble to GC after certain conditions hold, In practice, when those conditions occure, i was expecting to see a line on console that says that any of those bjects got finalized since i added a log line in an override of finalize method of object. so it seems like those objects never GC, I want to trace what objects holds reference to those specific objects preventing their GC. how is it done?

役に立ちましたか?

解決

Quoting the documentation:

When you see something suspicious, right-click on the item and select Path To GC Roots > exclude weak references. This opens a new tab that traces the references to that object which is causing the alleged leak.

You may also be interested in Patrick Duboy's Google I|O 2011 presentation on this topic. Here are the slides and the video.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top