如何跟踪和调试 Android 中的外部内存分配?
我正在尝试解决 Android 应用程序中的内存问题。
我确信内存泄漏不会发生在内部堆上,因为我已经使用内存分析器工具和 DDMS 中的堆/分配跟踪器彻底研究了这种可能性。
我相信要找到问题的根源,我必须查看外部堆上的分配,而不是内部堆上的分配。
10-05 18:17:06.221: DEBUG/dalvikvm(2559): GC_CONCURRENT 已释放 1137K,47% 已释放 4556K/8455K,外部 1625K/2137K,暂停 6ms+4ms
外部图是之前膨胀失控的那个碰撞。
有办法做到这一点吗?
干杯。
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.221: 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你用过MAT工具吗?这非常有用。
http://www.eclipse.org/mat/
如果您由于以下原因而遇到内存问题位图,请查看 WeakReference 或确保在完成后对位图调用 recycle()。
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.