首页 > 移动平台 > 详细

Android报错:java.lang.OutOfMemoryError: Failed to allocate a 74126220 byte allocation with 4190480 free bytes and 61MB until OOM

时间:2019-09-02 22:15:26      阅读:1590      评论:0      收藏:0      [点我收藏+]

错误代码:

  java.lang.OutOfMemoryError: Failed to allocate a 74126220 byte allocation with 4190480 free bytes and 61MB until OOM

错误原因:

  内存超了

解决方法:

  1、处理图片和视频减少加载量

  2、开启多个线程,避免所有处理都在主线程中处理

  3、在AndroidManifest.xml文件中的application标签中添加如下四行代码就解决问题了

  android:allowBackup="true"
  android:supportsRtl="true"
  android:largeHeap="true"
  android:hardwareAccelerated="false"
如下:
<application
    android:allowBackup="true"
    android:hardwareAccelerated="false"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:largeHeap="true"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

 

Android报错:java.lang.OutOfMemoryError: Failed to allocate a 74126220 byte allocation with 4190480 free bytes and 61MB until OOM

原文:https://www.cnblogs.com/hahayixiao/p/11364542.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!