java.lang.OutOfMemoryError: Failed to allocate a 2198284 byte allocation with 191616 free bytes and
程序员文章站
2022-06-13 21:29:28
...
解决:java.lang.OutOfMemoryError: Failed to allocate a 2198284 byte allocation with 191616 free bytes
或:java.lang.OutOfMemoryError: Failed to allocate a 20971532 byte allocation with 4194304 free bytes and 7MB until OOM
说明:在列表中上拉加载很多数据的时候出现的,由于列表中的控件有一个自定义的圆形头像图片导致的
<application
android:name=".im.ImApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:largeHeap="true"
android:hardwareAccelerated="false"
android:theme="@style/AppTheme">
需要在清单文件的application中加上下面两行代码:
android:largeHeap="true"
android:hardwareAccelerated="false"
推荐阅读
-
Android开发——错误:java.lang.OutOfMemoryError: Failed to allocate a 31961100 byte allocation with 152574
-
【Android】解决“java.lang.OutOfMemoryError: Failed to allocate a 8015852 byte allocation with 670144 fre
-
java.lang.OutOfMemoryError: Failed to allocate a 2198284 byte allocation with 191616 free bytes and
-
Android:java.lang.OutOfMemoryError: Failed to allocate a 23970828 byte allocation with 2097152 free
-
java.lang.OutOfMemoryError, Failed to allocate a 2822652 byte allocation with 284176 free bytes and ...
-
Failed to allocate a 38189038 byte allocation with 16777216 free bytes and 20MB until OOM