Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG:] Memory leak and application crash RNFetchBlob.fs.readStream #474

Open
nikolaytsigvintsev opened this issue Oct 25, 2019 · 0 comments

Comments

@nikolaytsigvintsev
Copy link

Hi !

Problem:

 Memory leak and application crash

System:

react-native: 0.59.9
react: 16.9.0
react-native-fs: 2.14.1
iPad: 12.1
Xcode: 11.0

I can’t understand why there is a memory leak and application crash when reading a large file using the read() function

Example test code:

onReadAssets = async () => {
const url = ${node.asset.url} // <—— Large file
await RNFetchBlob.fs.readStream(${node.asset.url}, 'base64', 16777216, 500) // 16MB chunk,
        .then((stream) => {
          stream.open()
          let i = 0
          stream.onData((chunk) => {
            console.log('<------ Send chunk', i++)
          })
          stream.onEnd(() => {
          })
        })
}

Video report:

https://www.dropbox.com/s/2zfmua0tqhar9o7/Screen%20Recording%202019-10-25%20at%2017.21.40.mov?dl=0

The same problems:

itinance/react-native-fs#785
facebook/react-native#26972

Thanks !

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

No branches or pull requests

1 participant