-
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
pm2 memory leak #4134
Comments
Hi, |
looks like there was a problem with pm2/[email protected] which fixed on 4.2.2 |
Great! Closing now |
I think you must have package.lock file in order to prevent this kind of issues in the future. Thanks |
@shimiml4 I also got memory leak when use PM2 in 3.5.1,now I downgrade to 3.4.1 which is fine in these days. |
Same here using version With I'm using node 'use strict';
const sharp = require('sharp');
module.exports = class extends require('./interface') {
static image(source, target, config) {
return sharp(source)
.resize(config.width, config.height, config.options)
.jpeg(config.quality)
.toFile(target);
}
}
After 2.000 images processed, memory is 3.8G.
I need to restart pm2 on every image resize batch process. |
As @eminoda say, downgrading to 3.4.1 solves the problem. |
no its not solve the problem. |
Any updates ? |
Is this still an issue for anyone on v |
Still having this issue with 4.5.1 |
Still having this issue with 4.5.2. |
I have this issue with 5.1.0 |
I have this issue with 5.2, please refer to #5145 |
Update: I fixed the memory problem by using |
@TheAndroidGuy I have 2 servers running, one with pm2 takes a huge amount of memory, the other just runs normally. I really don't think I can make that judgement. And according to this nodejs/node#21973 nodejs rejected to use jemalloc |
@qiulang you can still use jemalloc and as the issue you linked to states it's useful for some work loads. All depends on your use case. |
Indeed we determined that To fix this, simply disable pmx in your {
"apps": [
{
"name": "your-app-name",
"script": "app.js",
"exec_mode": "cluster_mode",
"wait_ready": true,
"instances": "max",
+ "pmx": false,
"env_production": {
"NODE_ENV": "production"
}
}, Then delete and restart all via References:
|
how would we set "pmx: false" via the js api? |
What's going wrong?
Memory of server is slowly increasing and I got out of memory.
I’ve been debugging my server in chrome, the memory periodically keeps objects that seems to histogram every 0.5 ~ 1 second. According to this document, it is supposed to keep datas only last 5 minutes by default, but continuous keep holding objects and slowly increase the memory. I’ve tried turn this metric off, it is default function in pm2 I guess. Pm2 needs extra function to turn metrics off or control period
How could we reproduce this issue?
Just run server with pm2 and debugging with chrome devtool
Supporting information
The text was updated successfully, but these errors were encountered: