Leaking memory with ActionBarSherlock

本小妞迷上赌 提交于 2020-01-14 22:32:35

问题


After each rotation of phone, whole Activity, with the ViewPager, all Fragments, ListViews etc are not GCed. I can tell because of OutOfMemoryError after 30-something roations and from MAT, which tells me I have 30-something instances of ListViews.

After getting rid of nearly everything in my app and leaving ActionBarSherlock, it turns out, that it's the one responsible for leak.

I'm debugging on 2.3.7 Desire.

Is there a problem with ABS library?


回答1:


No there isn't!

Hope someone can explain it to me, but apparently, when you run your app from your device menu, not from debug perspective, the leak disappears.

For more details, check out this closed issue: https://github.com/JakeWharton/ActionBarSherlock/issues/413

And thanks Jake for a great library!:)



来源:https://stackoverflow.com/questions/10305037/leaking-memory-with-actionbarsherlock