问题描述
我使用Picasso将相机中的图像加载到回收站视图中,然后将其上传到服务器中。 我的毕加索(Picasso)往往会给我一个OOM(内存不足)错误,我正在寻找一种清除缓存的方法,而不必跳过它或禁用缓存。
Starting a blocking GC Alloc
10-08 01:00:08.928 11110-11110/com.example E/PicassoUtil$getPicasso: Picasso error! Uri: /n4e/services/rest/images/63726073
java.lang.RuntimeException: ===============BEGIN PICASSO STATS ===============
Memory Cache Stats
Max Cache Size: 76695844
Cache Size: 75497472
Cache % Full: 99
Cache Hits: 0
Cache Misses: 33
Network Stats
Download Count: 0
Total Download Size: 0
Average Download Size: 0
Bitmap Stats
Total Bitmaps Decoded: 29
Total Bitmap Size: 91226112
Total Transformed Bitmaps: 0
Total Transformed Bitmap Size: 0
Average Bitmap Size: 3145728
Average Transformed Bitmap Size: 0
===============END PICASSO STATS ===============
at com.squareup.picasso.BitmapHunter.run(BitmapHunter.java:180)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
at com.squareup.picasso.Utils$PicassoThread.run(Utils.java:411)
Caused by: java.lang.OutOfMemoryError: Failed to allocate a 3145740 byte allocation with 1040648 free bytes and 1016KB until OOM
at dalvik.system.vmruntime.newNonMovableArray(Native Method)
at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
at android.graphics.BitmapFactory.decodeStreamInternal(BitmapFactory.java:635)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:611)
at com.squareup.picasso.BitmapHunter.decodeStream(BitmapHunter.java:142)
at com.squareup.picasso.BitmapHunter.hunt(BitmapHunter.java:217)
at com.squareup.picasso.BitmapHunter.run(BitmapHunter.java:159)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
at com.squareup.picasso.Utils$PicassoThread.run(Utils.java:411)
10-08 01:00:09.038 11110-17072/com.example I/art: Clamp target GC heap from 526MB to 512MB
10-08 01:00:09.038 11110-17072/com.example I/art: Alloc concurrent mark sweep GC freed 20897(582KB) AllocSpace objects,1(20KB) LOS objects,0% free,510MB/512MB,paused 6.959ms total 194.480ms
10-08 01:00:09.038 11110-17072/com.example I/art: Forcing collection of SoftReferences for 3MB allocation
10-08 01:00:09.038 11110-17072/com.example I/art: Starting a blocking GC Alloc
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)