-
Notifications
You must be signed in to change notification settings - Fork 986
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
[BUGS:] Memory leak and application crash on reading a large file #785
Comments
I'm currently struggling with the same issue. Using the |
any update on this issue. |
this is still unresolved, unfortunately. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 filefor (let i = 0; i < 1000; i++) {
await RNFS.read(url, 16777216, 0, 'base64').then((data) => { // 16777216 - 16MB chunk, 0 - start seek
console.log('Read file', i)
}).catch(err => console.log(err))
}
}
Video report: https://www.dropbox.com/s/3lzcrtzst0dnomw/Screen%20Recording%202019-10-18%20at%2010.49.43.mov?dl=0
If I use a function without 'async', then the function recursively calls itself and the application crash
Example test code:
onReadAssets = () => {
const url =
${node.asset.url}
// <—— Large filefor (let i = 0; i < 1000; i++) {
RNFS.read(url, 16777216, 0, 'base64').then((data) => { // 16777216 - 16MB chunk, 0 - start seek
console.log('Read file', i)
}).catch(err => console.log(err))
}
}
Video report: https://www.dropbox.com/s/aq3y9dfeqo4mo7o/Screen%20Recording%202019-10-18%20at%2010.52.40.mov?dl=0
I found a similar problem in :
#746
Thanks.
The text was updated successfully, but these errors were encountered: