android - 对于 Android 中的此进程,外部分配太大

标签 android memory-management

我的应用程序出现“外部分配对于此进程而言太大”错误。一次有很多:

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 的评论是我特定情况下的答案:

The framework will often capture views onscreen into temporary bitmaps for drawing performance. It looks like your app is pushing right up against its memory limit already and this bumps it over. Take a look at the other suggestions for limiting your app's memory usage.

关于android - 对于 Android 中的此进程,外部分配太大,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4193917/

相关文章:

android - 禁用应用程序的 Android O 自动填充服务

android - 将数据从 Android 应用程序发送到 Web 服务

c - 为结构内的结构分配内存

C++在不同的函数中重新分配指向动态内存中数组的指针

c++ - 如何在编译器级别实现 `delete[] obj` 和 `delete obj`

当网络调用完成时Java同步返回

Android pathshape绘制动态线

android - 使用zxing android进行二维码解码图像

java - Android 并在剩余可用堆空间的情况下运行 OOM

c++ - 删除算子内存管理