react-native-fs icon indicating copy to clipboard operation
react-native-fs copied to clipboard

Reading chunks from a large file fails

Open 7adidaz opened this issue 1 year ago • 3 comments

I'm trying to read a chunk of size 50 MB from a ~130 MB file, I'm using RNFS.read, according to docs this reads a specific length starting from an offset, but this 50MB chunk tries to allocate memory equal to the whole file size and this fails due to ram size.

Tried with 15 MB, and it worked like a charm. Tried with 30 MB, but it tried to allocate 80 MB of RAM which failed.

Am I missing something here? why it does try to allocate more memory than it need?

7adidaz avatar Mar 31 '24 18:03 7adidaz

Same problem. @7adidaz did you find any solution?

sagark1510 avatar Jul 18 '24 08:07 sagark1510

@sagark1510 nope, if I remember correctly, there was a memory leak related to this function, check out: 785

7adidaz avatar Jul 18 '24 09:07 7adidaz