-
Notifications
You must be signed in to change notification settings - Fork 2.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
Memory leak on cluster mode for sails js #1453
Comments
How is this related to pm2? |
I am not sure but it only happens on cluster mode not fork mode (standalone sails app) |
So? No memory leak with express in cluster mode? Conclusion: it should be related to sails. |
Which version of Node.js and Sails exactly ? Thanks for reporting this @shumailarshad |
Bug confirmed. Inspecting this |
That is not problem. Please do let me know if you need any help in fixing this bug or any other. Also, if you need to any more testing on my side, please do let me know. |
So I didn't write single line of code. Just did |
Yep thanks. I managed to reproduce it. |
Just to add. As @soyuka mentioned that issue I opened with sails. It seems to behave correctly if we turn off sockets, pubsub in .sailsrc file. But I still don't understand cause of the issue. |
I've done a few tests with express, sails and a basic http server : Basic http server :Express server :Sails server :Sails seems to be clearly leaking. More infos : https://github.com/soyuka/nodejs-http-memtest |
Closing as a non-pm2 issue |
Great work @soyuka 👍 |
I have created a new sails js app and did not change any code in it.
Than I used pm2 to launch two instance of that app. Memory keep increasing without hitting app even once.
I have done the same with basic express.js app with following code but it does not increase memory
"
var express = require('express');
var app = express();
app.get('/', function (req, res) {
res.send('Hello World!');
});
var server = app.listen(3000, function () {
var host = server.address().address;
var port = server.address().port;
console.log('Example app listening at http://%s:%s', host, port);
![screenshot from 2015-07-21 17 59 17](https://cloud.githubusercontent.com/assets/10924934/8821626/25280e54-3057-11e5-9641-ec90fff5689a.png)
});
"
After around 2 - 3 hrs.. It comes up to:
After leaving it overnight.. It comes up to:
![screenshot from 2015-07-22 09 11 44](https://cloud.githubusercontent.com/assets/10924934/8821616/0da2a6f4-3057-11e5-96ae-35986961c589.png)
The text was updated successfully, but these errors were encountered: