glide
glide copied to clipboard
downloadOnly method in multi thread maybe ANR
version:4.16.0 I just want to use the downloadOnly method to downlaod a large number pics(more then 3000),i use one background thread it working very well,but a little slow, so i give one thread with one downloadOnly ask, but ANR happened sometimes,i need help,how can i solve the problem?please。 the log has a lot of object waiting:
`"glide-active-resources" prio=5 tid=30 Waiting | group="main" sCount=1 ucsCount=0 flags=1 obj=0x12d02a90 self=0x70858c6ca290 | sysTid=7304 nice=10 cgrp=default sched=0/0 handle=0x7083f310bcf0 | state=S schedstat=( 175835 61626 3 ) utm=0 stm=0 core=2 HZ=100 | stack=0x7083f3009000-0x7083f300b000 stackSize=1035KB | held mutexes= at java.lang.Object.wait(Native method)
- waiting on <0x05243ab3> (a java.lang.Object) at java.lang.Object.wait(Object.java:442) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:190)
- locked <0x05243ab3> (a java.lang.Object) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:211) at com.bumptech.glide.load.engine.ActiveResources.cleanReferenceQueue(ActiveResources.java:128) at com.bumptech.glide.load.engine.ActiveResources$2.run(ActiveResources.java:61) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at com.bumptech.glide.load.engine.ActiveResources$1$1.run(ActiveResources.java:43) at java.lang.Thread.run(Thread.java:920)`
the log is from version:4.13.2, but it happend on 4.16.0 again
Active resources has its own thread, it shouldn't lead to deadlock. I do not see deadlock in the stack traces you provided, only an idle thread waiting on a queue.
For an ANR I'd be looking at what your main thread is doing.