itinance / itinance/react-native-fs
Reading chunks from a large file fails
- Dominant language
- C++
- Stars
- 5k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying to read a chunk of size 50 MB from a ~130 MB file, I'm using [RNFS.read](https://github.com/itinance/react-native-fs?tab=readme-ov-file#readfilepath-string-length--0-position--0-encodingoroptions-any-promisestring), 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?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.