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

vscode: "Allocation failed - JavaScript heap out of memory" for large dataset #110

Open
bkmeneguello opened this issue Oct 11, 2019 · 4 comments
Projects

Comments

@bkmeneguello
Copy link

bkmeneguello commented Oct 11, 2019

Besides a lot of RAM available this error happens when I try to open a large CSV file (803MB).

Console shows:

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: 0x562d86afdd15  [/usr/share/code/code]
 2: 0x562d86afde8a  [/usr/share/code/code]
 3: 0x562d837914f1  [/usr/share/code/code]
 4: 0x562d8383e6f2  [/usr/share/code/code] 
 5: 0x562d83846d04  [/usr/share/code/code]
 6: 0x562d83406f4c v8::internal::Factory::NewRawOneByteString(int, v8::internal::PretenureFlag) [/usr/share/code/code]
 7: 0x562d83866c64  [/usr/share/code/code]
 8: 0x562d837afe89 v8::String::Utf8Length(v8::Isolate*) const [/usr/share/code/code]
 9: 0x562d86b283ee  [/usr/share/code/code]
10: 0x562d83155781  [/usr/share/code/code]
11: 0x562d839ffd0e  [/usr/share/code/code]
@danmarshall
Copy link
Contributor

Hi @bkmeneguello, thanks for posting this. There will of course, be some maximum limit of what can be loaded / displayed. Currently, we don't know exactly what that limit is, but it is probably around 500k rows.

A followup issue, is that the app should fail more gracefully than crashing.

@bkmeneguello
Copy link
Author

Hi @danmarshall, thanks for your answer but where these limits come from? It's a js engine limitation or something that could be tuned? I have enough memory to accommodate all these data multiple times, so there could be possible to load lots of data (also for video memory). I understand if this can lead to performance issues since js is single threaded and workers aren't always an option.

@danmarshall
Copy link
Contributor

Hi @bkmeneguello, searching that error message, I see the there is a 1GB limit for Node.js heap size: nodejs/node#17878 (comment)

We probably need to have a chunking strategy instead of loading the entire file all at once.

@danmarshall
Copy link
Contributor

I'd be happy to take a PR for splitting the file into chunks.
The backend code is here, and the frontend code is here

That will get us around this specific error message, but we may have the same buffer problem in the frontend, eventually. Not sure how to deduce what the limits of one's browser should be.

@danmarshall danmarshall added this to TODO in Tasks Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Tasks
  
TODO
Development

No branches or pull requests

2 participants