【发布时间】:2011-05-10 18:49:45
【问题描述】:
我的应用中出现“external allocation too large for this process”错误。一次有很多这样的:
11-16 10:56:59.230: ERROR/dalvikvm-heap(2875): 1303680-byte external allocation too large for this process.
11-16 10:56:59.230: ERROR/GraphicsJNI(2875): VM won't let us allocate 1303680 bytes
11-16 10:56:59.230: ERROR/dalvikvm-heap(2875): 1536000-byte external allocation too large for this process.
11-16 10:56:59.230: ERROR/GraphicsJNI(2875): VM won't let us allocate 1536000 bytes
它们似乎是在渲染布局时生成的,在加载大位图之后。但是,在位图解码时不会产生错误。
如何调试这些错误?任何额外的指针?
【问题讨论】:
-
该框架通常会将屏幕上的视图捕获到临时位图中以提高绘图性能。看起来你的应用程序已经在推动它的内存限制,这让它颠倒了。查看其他关于限制应用内存使用的建议。
-
@adamp 非常有趣。这种行为是否记录在某处?
-
是的。查看与绘图缓存相关的 View 类的各种方法。它是应用程序也可以使用的公共 API。