bumptech / bumptech/glide

NoSuchElementException during memory trimming

Open
#4,391 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
35k
Forks
6.2k
Avg merge
1d 11h
Merged PRs (30d)
8

Description

**Glide Version**: 4.11.0

**Device/Android Version**: Variety of devices

**Issue details / Repro steps / Use case background**: We see a lot of crash reports in Firebase crashlytics. On 91% of devices this happens in background, approximate free RAM is 1GB+.

**Stack trace / LogCat**:
```ruby
Fatal Exception: java.util.NoSuchElementException
at java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:759)
at java.util.LinkedHashMap$LinkedEntryIterator.next(LinkedHashMap.java:790)
at java.util.LinkedHashMap$LinkedEntryIterator.next(LinkedHashMap.java:788)
at com.bumptech.glide.util.LruCache.trimToSize(LruCache.java:169)
at com.bumptech.glide.load.engine.cache.LruResourceCache.trimMemory(LruResourceCache.java:56)
at com.bumptech.glide.Glide.trimMemory(Glide.java:692)
at com.bumptech.glide.Glide.onTrimMemory(Glide.java:900)
at android.app.Application.onTrimMemory(Application.java:306)
at android.app.ActivityThread.handleTrimMemory(ActivityThread.java:6653)
at android.app.ActivityThread.access$1400(ActivityThread.java:274)
at android.app.ActivityThread$ApplicationThread.lambda$scheduleTrimMemory$0(ActivityThread.java:1742)
at android.app.-$$Lambda$ActivityThread$ApplicationThread$tUGFX7CUhzB4Pg5wFd5yeqOnu38.accept(:8)
at com.android.internal.util.function.pooled.PooledLambdaImpl.doInvoke(PooledLambdaImpl.java:271)
at com.android.internal.util.function.pooled.PooledLambdaImpl.invoke(PooledLambdaImpl.java:195)
at com.android.internal.util.function.pooled.OmniFunction.run(OmniFunction.java:86)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:999)
at android.view.Choreographer.doCallbacks(Choreographer.java:797)
at android.view.Choreographer.doFrame(Choreographer.java:734)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:984)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8167)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.