03-11 10:19:12.894 1904-2250/com.baiaphoto.android E/dalvikvm-heap: Out of memory on a 5898256-byte allocation.
03-11 10:19:12.894 1904-2250/com.baiaphoto.android I/dalvikvm: "Picasso-/storage/emulated/0/baiaphotos/image-default.png" prio=5 tid=21 RUNNABLE
03-11 10:19:12.894 1904-2250/com.baiaphoto.android I/dalvikvm: | group="main" sCount=0 dsCount=0 obj=0x4392a8d0 self=0x68b9a888
03-11 10:19:12.894 1904-2250/com.baiaphoto.android I/dalvikvm: | sysTid=2250 nice=10 sched=0/0 cgrp=apps/bg_non_interactive handle=1755348024
03-11 10:19:12.894 1904-2250/com.baiaphoto.android I/dalvikvm: | state=R schedstat=( 1923135000 790241000 935 ) utm=187 stm=5 core=0
03-11 10:19:12.894 1904-2250/com.baiaphoto.android I/dalvikvm: at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
03-11 10:19:12.894 1904-2250/com.baiaphoto.android I/dalvikvm: at android.graphics.BitmapFactory.decodeStreamInternal(BitmapFactory.java:620)
03-11 10:19:12.894 1904-2250/com.baiaphoto.android I/dalvikvm: at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:596)
03-11 10:19:12.894 1904-2250/com.baiaphoto.android I/dalvikvm: at com.squareup.picasso.BitmapHunter.decodeStream(BitmapHunter.java:142)
03-11 10:19:12.894 1904-2250/com.baiaphoto.android I/dalvikvm: at com.squareup.picasso.BitmapHunter.hunt(BitmapHunter.java:217)
03-11 10:19:12.894 1904-2250/com.baiaphoto.android I/dalvikvm: at com.squareup.picasso.BitmapHunter.run(BitmapHunter.java:159)
03-11 10:19:12.894 1904-2250/com.baiaphoto.android I/dalvikvm: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
03-11 10:19:12.894 1904-2250/com.baiaphoto.android I/dalvikvm: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
03-11 10:19:12.894 1904-2250/com.baiaphoto.android I/dalvikvm: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
03-11 10:19:12.894 1904-2250/com.baiaphoto.android I/dalvikvm: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
03-11 10:19:12.894 1904-2250/com.baiaphoto.android I/dalvikvm: at java.lang.Thread.run(Thread.java:841)
03-11 10:19:12.894 1904-2250/com.baiaphoto.android I/dalvikvm: at com.squareup.picasso.Utils$PicassoThread.run(Utils.java:411)
答案 0 :(得分:0)
在没有看到确切的代码的情况下无法说明问题是什么,但是在使用Picasso将图像加载到ImageView中时,您是否尝试过.fit()或调整大小?在RecyclerView中加载许多(大)图像时,我遇到了类似的内存耗尽问题,并修复了它。
例如:
Picasso.with(context).load(imageURL).fit().into(exampleImageView);
More examples/explanation about re-sizing and scaling with Picasso