yyy000112 2016-12-29 12:56 采纳率: 43.8%
浏览 1728
已采纳

用Xutils3.0加载图片也出现内存溢出。。。?咋解决

12-29 20:38:53.460 1024-1024/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: android.ye.fashioncircle, PID: 1024
java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw OutOfMemoryError; no stack trace available
12-29 20:38:53.545 1568-1568/? E/QSEECOMD:: Listener: index = 0, hierarchy = 0
12-29 20:38:53.545 1568-1568/? E/QSEECOMD:: Init dlopen(librpmb.so, RLTD_NOW) is failed....
12-29 20:38:53.545 1568-1568/? E/QSEECOMD:: ERROR: RPMB_INIT failed, shall not start listener services
12-29 20:38:54.316 21890-21959/? E/anti: anti once
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] Runtime aborting...
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] Aborting thread:
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] "xTID#9" prio=5 tid=35 Native
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] | group="" sCount=1 dsCount=0 obj=0x32c1ed60 self=0xa0d98700
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] | sysTid=1101 nice=0 cgrp=default sched=0/0 handle=0x961fc930
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] | state=R schedstat=( 963313700 614145661 1024 ) utm=84 stm=12 core=1 HZ=100
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] | stack=0x960fa000-0x960fc000 stackSize=1038KB
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] | held mutexes= "abort lock"
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] native: #00 pc 00370e01 /system/lib/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiPKcPNS_9ArtMethodEPv+160)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] native: #01 pc 0035046f /system/lib/libart.so (_ZNK3art6Thread4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE+150)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] native: #02 pc 00333827 /system/lib/libart.so (_ZNK3art10AbortState10DumpThreadERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPNS_6ThreadE+26)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] native: #03 pc 00333abf /system/lib/libart.so (_ZN3art7Runtime5AbortEv+562)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] native: #04 pc 000f45fb /system/lib/libart.so (_ZN3art10LogMessageD2Ev+2226)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] native: #05 pc 0025aa4f /system/lib/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+1550)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] native: #06 pc 0025adfd /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortVEPKcS2_St9__va_list+64)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] native: #07 pc 000fd1d1 /system/lib/libart.so (_ZN3art11ScopedCheck6AbortFEPKcz+32)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] native: #08 pc 001022e5 /system/lib/libart.so (_ZN3art11ScopedCheck5CheckERNS_18ScopedObjectAccessEbPKcPNS_12JniValueTypeE.constprop.95+5072)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] native: #09 pc 00105fbb /system/lib/libart.so (_ZN3art8CheckJNI8ThrowNewEP7_JNIEnvP7_jclassPKc+438)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] native: #10 pc 000075e3 /data/app/android.ye.fashioncircle-1/lib/arm/libwebpbackport.so (_ZN7_JNIEnv8ThrowNewEP7_jclassPKc+6)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] native: #11 pc 000079b9 /data/app/android.ye.fashioncircle-1/lib/arm/libwebpbackport.so (Java_android_backport_webp_WebPFactory_nativeDecodeFile+332)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] native: #12 pc 0000051d /data/app/android.ye.fashioncircle-1/oat/arm/base.odex (android.graphics.Bitmap android.backport.webp.WebPFactory.nativeDecodeFile(java.lang.String, android.graphics.BitmapFactory$Options)+112)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] native: #13 pc 0000023d /data/app/android.ye.fashioncircle-1/oat/arm/base.odex (android.graphics.Bitmap android.backport.webp.WebPFactory.decodeFile(java.lang.String, android.graphics.BitmapFactory$Options)+80)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] native: #14 pc 002b0b71 /data/app/android.ye.fashioncircle-1/oat/arm/base.odex (android.graphics.Bitmap org.xutils.image.ImageDecoder.getThumbCache(java.io.File, org.xutils.image.ImageOptions)+820)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] native: #15 pc 002afe49 /data/app/android.ye.fashioncircle-1/oat/arm/base.odex (android.graphics.drawable.Drawable org.xutils.image.ImageDecoder.decodeFileWithLock(java.io.File, org.xutils.image.ImageOptions, org.xutils.common.Callback$Cancelable)+1404)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] native: #16 pc 0055a9eb /data/app/android.ye.fashioncircle-1/oat/arm/base.odex (android.graphics.drawable.Drawable org.xutils.image.ImageLoader.prepare(java.io.File)+334)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] native: #17 pc 0055accd /data/app/android.ye.fashioncircle-1/oat/arm/base.odex (java.lang.Object org.xutils.image.ImageLoader.prepare(java.lang.Object)+104)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] native: #18 pc 00540181 /data/app/android.ye.fashioncircle-1/oat/arm/base.odex (java.lang.Object org.xutils.http.HttpTask.doBackground()+1572)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] native: #19 pc 0028487b /data/app/android.ye.fashioncircle-1/oat/arm/base.odex (void org.xutils.common.task.TaskProxy$1.run()+774)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] native: #20 pc 00283cfb /data/app/android.ye.fashioncircle-1/oat/arm/base.odex (void org.xutils.common.task.PriorityRunnable.run()+62)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] native: #21 pc 003cebf7 /data/dalvik-cache/arm/system@framework@boot.oat (???)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] at android.backport.webp.WebPFactory.nativeDecodeFile(Native method)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] at android.backport.webp.WebPFactory.decodeFile(WebPFactory.java:58)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] at org.xutils.image.ImageDecoder.getThumbCache(ImageDecoder.java:661)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] at org.xutils.image.ImageDecoder.decodeFileWithLock(ImageDecoder.java:116)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] at org.xutils.image.ImageLoader.prepare(ImageLoader.java:375)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] at org.xutils.image.ImageLoader.prepare(ImageLoader.java:38)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] at org.xutils.http.HttpTask.doBackground(HttpTask.java:235)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] at org.xutils.common.task.TaskProxy$1.run(TaskProxy.java:62)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] at org.xutils.common.task.PriorityRunnable.run(PriorityRunnable.java:21)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
12-29 20:38:54.777 1024-1101/? A/art: art/runtime/runtime.cc:366] at java.lang.Thread.run(Thread.java:818)

  • 写回答

2条回答 默认 最新

  • 代先生- 2016-12-30 04:07
    关注

    看一下源码吧,你应该可以知道你得缓存存在什么位置,大小是多少,在图片显示的地方try catch 一下,出现OOM情况清楚一下缓存,还有就是图片如果加载过要调取缓存,这个问题在Imageloader中也出现过,也有人说过做一下内存管理,知道你们应用的内存大小,设置一下图片的所有缓存大小,当达到临界值的时候清除缓存,具体操作度娘一搜一大把。这样做应该是可以的

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥35 平滑拟合曲线该如何生成
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 自己瞎改改,结果现在又运行不了了
  • ¥15 链式存储应该如何解决
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站