Description
- I have reviewed the documentation
- I have searched existing issues
- I am using the latest React Native version
Environment
Environment:
OS: macOS Sierra 10.12.6
Node: 8.9.4
Yarn: 1.6.0
npm: 5.6.0
Watchman: 4.7.0
Xcode: Xcode 8.3.3 Build version 8E3004b
Android Studio: 3.1 AI-173.4720617
Packages: (wanted => installed)
react: 16.3.1 => 16.3.2
react-native: ~0.55.2 => 0.55.4
Steps to Reproduce
Execute request using fetch
, e.g.
fetch('https://www.facebook.com').then(res => { // fetch saves response to blob: res._bodyBlob._data });
Expected Behavior
Blob with fetch response should be released once res
is out of scope (GC-ed).
Actual Behavior
Blobs corresponding to fetch response are never released, leading to increasing memory usage during a lifetime of application. Leaked memory is at least of the size of all responses already received.
I have created a simple project, demonstrating memory leak: https://github.com/jesenko/react-native-fetch-memory-leak
Issue was probably introduced with #11573, and is thus affecting v0.54 and v0.55