You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix performance and memory usage of creating blob on Android (facebook#50121)
Summary:
This PR fixesfacebook#48657
- Memory usage for creating a blob lowered from _( nearest 2^N greater than the file size)+1KB_ previously To _(file size)+1KB_. This is achieved by avoiding internal calls to java.io.ByteArrayOutputStream.ensureCapacity by creating a buffer based on file size.
- Increases the max file size a Blob can be created from before hitting a OutOfMemoryException.
- Major performance increase by avoiding buffer copying
## Changelog:
[ANDROID] [CHANGED] - Speed and Memory usage improvements to Android Blob support
[ANDROID] [FIXED] - Creating of Blobs from large files now works. File size can now be upto available (free) heap size.
Pull Request resolved: facebook#50121
Test Plan: Used the App here to test Android Blob creation. https://github.com/giantslogik/blob-large-file-fetch.
Reviewed By: cortinico
Differential Revision: D71464835
Pulled By: javache
fbshipit-source-id: 38de7d83bcaee265fc6e7183f6b1160027cd4cb2
0 commit comments