Skip to content

fix/memory leaks for android especially during recycler view usage#123

Open
FrederickEngelhardt wants to merge 3 commits intomrousavy:mainfrom
FrederickEngelhardt:chore/fix-android-memory-leaks
Open

fix/memory leaks for android especially during recycler view usage#123
FrederickEngelhardt wants to merge 3 commits intomrousavy:mainfrom
FrederickEngelhardt:chore/fix-android-memory-leaks

Conversation

@FrederickEngelhardt
Copy link
Copy Markdown

Summary

Fixes Android native memory growth when rendering file-backed images through NitroImage / ImageLoader.

The previous Android file loader path could retain decoded image results and repeatedly decode images under high-churn rendering. In my app, rapidly switching or scrolling local images could grow native memory from a few hundred MB to over 1GB.

This PR adds an Android render-specific bitmap path for file-backed image loaders:

  • file loaders no longer permanently cache decoded HybridImage results
  • file render requests decode target-sized Bitmaps
  • displayed render bitmaps are owned and released by HybridImageView
  • stale async decode results are ignored/released
  • repeated file/target decodes are coalesced
  • a bounded render bitmap cache avoids repeatedly decoding the same image during rapid interaction

I verified the memory improvement on Android.

iOS may have a similar issue, but I intentionally omitted iOS changes because I do not currently have an iOS test device to validate the behavior or confirm a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant