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

Out of memory. nodejs using more than 100MB of RAM #1577

Closed
pixelfreak opened this issue Apr 5, 2014 · 10 comments
Closed

Out of memory. nodejs using more than 100MB of RAM #1577

pixelfreak opened this issue Apr 5, 2014 · 10 comments

Comments

@pixelfreak
Copy link

Is this normal? I've been running Node.js for a while now and only recently I have used sails. I ran 2 sails instances with sails-mysql, one for HTTP, another for HTTPS. Each of them starts at 75MB+ but quickly goes up to over 100MB and eventually crash due to out of memory :( (I have 512MB)

@pixelfreak
Copy link
Author

Strange, there are actually 4 nodejs processes. Even though I only run 2. Is that normal?

UPDATE: nevermind, I think those are forever processes.

@pixelfreak
Copy link
Author

Anyone else having any issue like this? I left it running for few days now and the memory climbed to 150MB with no sign of stopping... :(

@johntom
Copy link

johntom commented Apr 23, 2014

I've had issues In development mode with grunt and modified my gruntfile as a fix.

@pixelfreak
Copy link
Author

Can you elaborate how you fixed it? Thank you

@johntom
Copy link

johntom commented Apr 24, 2014

see matt k comments on 2 lines below
/************************************
* Jade linker end
******************************_/
},
watch: {
api: {
// API files to watch:
// files: ['api/__/'] //matt k change
files: ['api/{,
/}_.js']
},
assets: {
// Assets to watch:
//files: ['assets/
/'], //matt k change
files: ['assets/linker/js/app/{,/}.js'],
// When assets are changed:
tasks: ['compileAssets', 'linkAssets', 'logger:Ready To Go:beep']
}
}
});

@pixelfreak
Copy link
Author

Thanks, but I can't find these snippet of code anywhere. I am updating some packages and will post when I found something

@pixelfreak
Copy link
Author

I updated all my packages and I am still seeing the memory leak :(

@johntom Still can't find those code you mentioned

@mikermcneil
Copy link
Member

@johntom thanks for posting your solution!

@pixelfreak hmm, strange.. a few questions:

  • What version of Sails and sails-mysql are you running?
  • Are you seeing this issue when you run Sails in production as well as development? Or only in development?
  • Do you see this issue with other adapters, e.g. sails-postgresql?
  • How big is the dataset you're working with?

still seeing the memory leak

Is this a memory leak? I'd be curious to see if this continued to climb after 150MB? I usually see around 60MB (main process) + 40MB (grunt) in development, which is pretty standard. Also worth noting is that sails-mysql uses a connection pool, which trades higher memory usage for faster queries.

cc @particlebanana

Finally, a request: As part of the effort to keep things organized, would you move this issue to the waterline repo, or if we determine it is adapter-specific, to the sails-mysql repo? Thank you!

@pixelfreak
Copy link
Author

@mikermcneil

What version of Sails and sails-mysql are you running?
[email protected]
[email protected]
[email protected]

Are you seeing this issue when you run Sails in production as well as development? Or only in development?
Production. Doesn't seem to happen on development but I might be wrong.

Do you see this issue with other adapters, e.g. sails-postgresql?
I don't use other adapters

How big is the dataset you're working with?
Not big at all. The DB is only 20KB.

The memory usage goes up even higher closer to 200MB. I have to restart the process periodically now because I am running out of memory. :(

Moving this to waterline repo.

@mikermcneil
Copy link
Member

For future reference, there's more information and tips on diagnosing memory leaks in Node apps, and on reproducing+reporting suspected memory leaks in Sails here: #3782 (comment)

@balderdashy balderdashy locked and limited conversation to collaborators Aug 9, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants