質問

Sounds like a stupid question, but I can't think of any possible way to do it.

Ideally, I would like to check for memory leaks with suspicious Activities / Services that were onDestroy' ed, but seem to be in RAM.

役に立ちましたか?

解決

You can create WeakReference to your activity. Be careful and do not keep any hard/soft references. Call GC (e.g. from another activiy) and check if reference is null or not. Keep in mind that android can keep activity in memory to reuse it.

You can use finalize method for debug purpose. You must not use it in Release version and remove it.

Also you can use MAT as @Simon suggested to see all Objects of your application.

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