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

High Memory Usage? #856

Closed
aneesh-neelam opened this issue Feb 16, 2015 · 7 comments
Closed

High Memory Usage? #856

aneesh-neelam opened this issue Feb 16, 2015 · 7 comments
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.

Comments

@aneesh-neelam
Copy link

I have a JSON API using Express.js running on Heroku(Using the free dyno)

On Node.js 0.10.35, the Express.js server on startup uses around 80 MB of RAM, gradually going up and stabilizing at around 200 MB, even on peak load. But on io.js 1.2.0, the same code on startup uses around 115 MB of RAM, going up and stabilizing at 480 MB, even on minimal load!

I've checked the memory usage using New Relic and Heroku Labs' log-runtime-metrics. I haven't checked the code against Node.js 0.12.0 yet, I'll do that shortly.

I'm checking to see if I have inadvertantly written code that causes a memory leak. However, is this high RAM usage normal for io.js 1.2.0, compared to Node.js 0.10?

@madbence
Copy link

If RAM usage is stable at 480MB, then it's not a memory leak 😄

@aneesh-neelam aneesh-neelam changed the title Memory Leak? High Memory Usage? Feb 16, 2015
@Fishrock123
Copy link
Member

Dupe of #823. This is the nature of v8 and javascript. Start-up and stable memory is not a good indicator of anything other than business as usual. :)

@aneesh-neelam If you want a better benchmark, please compare against node 0.12. Most of the changes that directly affect this were done in the 0.11.x era.

@Fishrock123 Fishrock123 added the duplicate Issues and PRs that are duplicates of other issues or PRs. label Feb 16, 2015
@aneesh-neelam
Copy link
Author

I have tested the same code against Node.js 0.12.0, it's similar to io.js, a little higher ~500 MB.

@Fishrock123: I understand. But please know that the Production server consumes around 190-200 MB at a peak load. but the Dev server running Node.js 0.12.0/io.js 1.2.0 consumes ~480 MB of RAM at a constant minimal load of 2 HTTP requests per minute.

Since the Heroku free dyno has a memory limit of 512 MB, I'm afraid it might hit memory limits on production. And I have no idea why it should take up so much more memory.

@bnoordhuis
Copy link
Member

@aneesh-neelam By design, V8 will use as much memory as possible, up to a 1.4-1.9 GB limit. If your box has less memory than that, you can tweak the limit with --max_old_space_size=$megabytes. There is no hard rule for the optimum setting but a little over half of physical memory is usually a good starting point.

@aneesh-neelam
Copy link
Author

@bnoordhuis: Alright I'll do that. Thank you.

@Harishgolla
Copy link

@aneesh-neelam Does setting --max_old_space_size=$megabytes fixed your issue of memory usage?

@aneesh-neelam
Copy link
Author

@Harishgolla: This issue was fixed in a later version of Node.js/io.js. I believe the original issue was #1075. And no, that setting didn't help at the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.
Projects
None yet
Development

No branches or pull requests

5 participants