-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Remove 1GB max size limit for Buffer #1719
Comments
The limit comes from v8 implementation details, there is nothing we could do about it in node.js |
What @petkaantonov said, it's because of this V8 limit, which is in place for a number of reasons, mostly to do with V8's use of tagged integers (or SMIs) to store the length. The switch to typed arrays in 4.4 isn't really going to change that because the same size restriction applies to typed arrays (and the arraybuffers that back them.) I'll close the issue. It's something that is outside of our control. |
Fair enough. For anyone interested, here is the V8 bug to star for this issue: https://code.google.com/p/v8/issues/detail?id=3505 |
Actually that issue is not related to buffer sizes but other objects that currently have even lower limits than buffers, for different reason. |
Don't typed arrays subclass from |
They don't subclass array but that is not related to these issues. The issue you linked is about increasing string and regular array sizes from already low limits (e.g. 128mb or 512mb) to the maximum possible smi limit (e.g. 1GB). The smi limit itself is a separate issue that cannot be raised (well you could make it 2GB on 64 bit). |
Sounds like the 1GB limit will be lifted with the move to V8 4.4 after all. See: https://twitter.com/trevnorris/status/603345087028793345 |
@feross ArrayBuffer's can be arbitrarily large. It's that the index size cannot exceed @domenic has suggested we allow ArrayBuffer to be passed to all APIs that support an Buffer. I'm considering how that could be done to give us a sweet spot of allowing the transfer of data within node to be encapsulated in an ArrayBuffer (support for arbitrary size) while also allowing to work with the data using multiple buffer instances if needed. |
@trevnorris For starters, we could just make the |
@feross We'd have to also allow |
I think I'm running into some of the consequences of these limits here: Surprised that I'm getting a call stack exception though.... |
FYI: I'm working on supporting big |
@bmeurer did this ever happen? https://stackoverflow.com/questions/64056286/in-2018-a-tech-lead-at-google-said-they-were-working-to-support-buffers-way-bey I don't understand how 64 bit range buffer addressing is beyond the reach of Node on 64 bit systems in 2020 Edit: If I understand right, it's actually a solved issue in V8, but Node.js still decided on a 4294967295 buffer limit for some reason |
@jt0dd Lines 5348 to 5355 in 785a5f9
As to that SO post, see commit 5005c3c: most platforms don't allow I/O operations > 2 GB. |
Buffer
instances currently have a max size of 1GB (enforced in smalloc.h). This isn't ideal.I know
Buffer
is being rewritten for V8 4.4, but wanted to open a separate issue to track this limitation.The text was updated successfully, but these errors were encountered: