Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android studio 在Android中清除毕加索缓存而不跳过它的简单方法_Android Studio_Garbage Collection_Picasso_Android Bitmap_Java Memory Leaks - Fatal编程技术网

Android studio 在Android中清除毕加索缓存而不跳过它的简单方法

Android studio 在Android中清除毕加索缓存而不跳过它的简单方法,android-studio,garbage-collection,picasso,android-bitmap,java-memory-leaks,Android Studio,Garbage Collection,Picasso,Android Bitmap,Java Memory Leaks,我使用毕加索将相机中的图像加载到回收器视图中,然后将其上传到服务器。 我的毕加索倾向于给我一个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.lan

我使用毕加索将相机中的图像加载到回收器视图中,然后将其上传到服务器。 我的毕加索倾向于给我一个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