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

Nodejs not allowing buffer size greater than 1GB on 64-bit architecture #4445

Closed
ivish opened this issue Dec 28, 2015 · 4 comments
Closed

Nodejs not allowing buffer size greater than 1GB on 64-bit architecture #4445

ivish opened this issue Dec 28, 2015 · 4 comments
Labels
buffer Issues and PRs related to the buffer subsystem.

Comments

@ivish
Copy link

ivish commented Dec 28, 2015

From the documentation:
new Buffer(size)
'size' must be less than 1,073,741,824 bytes (1 GB) on 32-bit architectures or 2,147,483,648 bytes (2 GB) on 64-bit architectures. Otherwise, a RangeError is thrown.

@mscdex mscdex added the buffer Issues and PRs related to the buffer subsystem. label Dec 28, 2015
@mscdex
Copy link
Contributor

mscdex commented Dec 28, 2015

The documentation is correct. Are you asking for the rationale or ?

@ivish
Copy link
Author

ivish commented Dec 28, 2015

If the doc is correct. Why it's not working when I am trying to allocate more than 1GB. I get RangeError.

@mscdex
Copy link
Contributor

mscdex commented Dec 28, 2015

What version of node are you trying with? Is it a 64-bit executable? What platform are you on?

FWIW creating a >1GB buffer works for me on Linux with 64-bit node v4.2.3 and v5.3.0.

@ivish
Copy link
Author

ivish commented Dec 28, 2015

Okay, thanks.. I was testing that on aws ec2 with node v4.2.3. And I got why it wasn't working. My instance was having just 1GB memory.. So.. Sorry, I didn't notice that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buffer Issues and PRs related to the buffer subsystem.
Projects
None yet
Development

No branches or pull requests

2 participants