开发者

How to trace and debug external memory allocations in Android?

I am trying to fix a memory issue in an Android application.

I am convinced that the memory leak is not happening on the internal heap, as I have thoroughly investigated this possibility using the Memory Analyzer Tool, and the Heap/Allocation Tracker in DDMS.

I believe to find the source of the problem, I have to look at the allocations on the external heap, rather than the internal heap.

10-05 18:17:06.22开发者_开发百科1: DEBUG/dalvikvm(2559): GC_CONCURRENT freed 1137K, 47% free 4556K/8455K, external 1625K/2137K, paused 6ms+4ms

The external figure is the one that is ballooning out of control before a crash.

Is there a way to do this?

Cheers.


Have you used the MAT tool? It's very useful.

http://www.eclipse.org/mat/

If you're having problems with memory due to Bitmaps, look into WeakReference or make sure to call recycle() on your bitmaps when you're done.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜