我有RecyclerView几个图像使用Picasso.在向上和向下滚动一段时间后,应用程序内存不足,并显示如下消息:
E/dalvikvm-heap? Out of memory on a 3053072-byte allocation.
I/dalvikvm? "Picasso-/wp-content/uploads/2013/12/DSC_0972Small.jpg" prio=5 tid=19 RUNNABLE
I/dalvikvm? | group="main" sCount=0 dsCount=0 obj=0x42822a50 self=0x59898998
I/dalvikvm? | sysTid=25347 nice=10 sched=0/0 cgrp=apps/bg_non_interactive handle=1500612752
I/dalvikvm? | state=R schedstat=( 10373925093 843291977 45448 ) utm=880 stm=157 core=3
I/dalvikvm? at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
I/dalvikvm? at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:623)
I/dalvikvm? at com.squareup.picasso.BitmapHunter.decodeStream(BitmapHunter.java:142)
I/dalvikvm? at com.squareup.picasso.BitmapHunter.hunt(BitmapHunter.java:217)
I/dalvikvm? at com.squareup.picasso.BitmapHunter.run(BitmapHunter.java:159)
I/dalvikvm? at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390)
I/dalvikvm? at java.util.concurrent.FutureTask.run(FutureTask.java:234)
I/dalvikvm? at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
I/dalvikvm? at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
I/dalvikvm? at java.lang.Thread.run(Thread.java:841)
I/dalvikvm? at com.squareup.picasso.Utils$PicassoThread.run(Utils.java:411)
I/dalvikvm? [ 08-10 …Run Code Online (Sandbox Code Playgroud) 我无法使用Android 9.0 Pie中的Picasso库加载图像.实际上,它适用于以下版本.它没有显示任何错误消息.有人用Github分享了他的日志
Picasso.get().setLoggingEnabled(true);
Run Code Online (Sandbox Code Playgroud)
他有消息日志:
2018-10-19 13:13:20.467 24840-24862/com.xyz.test.testpicasso D/ViewContentFactory: initViewContentFetcherClass
2018-10-19 13:13:20.467 24840-24862/com.xyz.test.testpicasso I/ContentCatcher: ViewContentFetcher : ViewContentFetcher
2018-10-19 13:13:20.467 24840-24862/com.xyz.test.testpicasso D/ViewContentFactory: createInterceptor took 0ms
2018-10-19 13:13:20.468 24840-24862/com.xyz.test.testpicasso I/ContentCatcher: Interceptor : Catcher list invalid for com.xyz.test.testpicasso@com.xyz.test.testpicasso.MainActivity@147874166
2018-10-19 13:13:20.468 24840-24862/com.xyz.test.testpicasso I/ContentCatcher: Interceptor : Get featureInfo from config pick_mode
2018-10-19 13:13:20.485 24840-24840/com.xyz.test.testpicasso D/Picasso: Main created [R1] Request{https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png}
2018-10-19 13:13:20.492 24840-24864/com.xyz.test.testpicasso D/Picasso: Dispatcher enqueued [R1]+6ms
2018-10-19 13:13:20.492 24840-24866/com.xyz.test.testpicasso D/Picasso: Hunter executing [R1]+7ms
2018-10-19 13:13:20.555 1531-1684/? I/ActivityManager: Displayed com.xyz.test.testpicasso/.MainActivity: +114ms
2018-10-19 13:13:20.555 5475-5603/? D/PowerKeeper.Event: notifyActivityLaunchTime: …Run Code Online (Sandbox Code Playgroud)