Bin*_*Bin 5 java android out-of-memory
我在我的 Android 应用程序中遇到了这样的异常java.lang.OutOfMemoryError: Failed to allocate a 32 byte allocation with 0 free bytes and 3GB until OOM。0 空闲字节是什么意思?和3GB?
0 可用字节的含义正如所言。我不明白的一点是3GB until next OOM
我通过 Android 源代码进行 root,在这里您会看到此错误(在 Android 的某些随机版本中,我不确定是哪个)
oss << "Failed to allocate a " << byte_count << " byte allocation with " <<
total_bytes_free
<< " free bytes and " << PrettySize(GetFreeMemoryUntilOOME()) << " until OOM";
Run Code Online (Sandbox Code Playgroud)
3GB 的GetFreeMemoryUntilOOME功能看起来是这样的:
// Returns approximately how much free memory we have until the next OOME happens.
size_t GetFreeMemoryUntilOOME() const {
return growth_limit_ - GetBytesAllocated();
}
Run Code Online (Sandbox Code Playgroud)
我不确定 Growth_limit 是什么,但我读到它是最大堆大小?
这是一个糟糕的答案,我从 Android 源代码中猜测,但这里没有其他内容,所以我将发布它!
| 归档时间: |
|
| 查看次数: |
949 次 |
| 最近记录: |