我是靠谱客的博主 懵懂羊,这篇文章主要介绍Failed to allocate a 3112972 byte allocation with 2019776 free bytes and 1972KB until OOM,现在分享给大家,希望可以做个参考。
异常:java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Failed to allocate a 3112972 byte allocation with 2019776 free bytes and 1972KB until OOM
OOM:Android 内存溢出(Java的这个异常是指,内存申请失败,前面那个数字是你想申请分配的内存字节,后面的那个数是实际可用的系统内存,显然小于前者。)
解决方法:在清单文件中添加两行代码:
android:hardwareAccelerated="false"
android:largeHeap="true"
eg:
<application
android:name=".application.MyShowApplication"
android:allowBackup="true"
android:hardwareAccelerated="false"
android:icon="@mipmap/cat"
android:label="@string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:theme="@style/AppTheme">
最后
以上就是懵懂羊最近收集整理的关于Failed to allocate a 3112972 byte allocation with 2019776 free bytes and 1972KB until OOM的全部内容,更多相关Failed内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复