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

Reading chunks from a large file fails #1233

Open
7adidaz opened this issue Mar 31, 2024 · 0 comments
Open

Reading chunks from a large file fails #1233

7adidaz opened this issue Mar 31, 2024 · 0 comments

Comments

@7adidaz
Copy link

7adidaz commented Mar 31, 2024

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?

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