Node.js 如果通过';启动,PM2读取的内存不正确;npm启动';
PM2版本0.36.0 NodeJS版本15.0.1 结构Node.js 如果通过';启动,PM2读取的内存不正确;npm启动';,node.js,pm2,Node.js,Pm2,PM2版本0.36.0 NodeJS版本15.0.1 结构 pm2.config.js testpm2 ├── index.js └── package.json pm2.config.js module.exports ={ "apps": [ { "name": "my-test-app", "cwd": "./testpm2&q
pm2.config.js
testpm2
├── index.js
└── package.json
pm2.config.js
module.exports ={
"apps": [
{
"name": "my-test-app",
"cwd": "./testpm2",
"script": "npm",
"args": "start"
}
]
}
const arr = [];
setInterval(() => {
for (let i = 0; i < 100000; i += 1) {
arr.push('12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890');
}
console.log('running....', arr.length);
console.log(process.memoryUsage());
}, 100);
index.js
module.exports ={
"apps": [
{
"name": "my-test-app",
"cwd": "./testpm2",
"script": "npm",
"args": "start"
}
]
}
const arr = [];
setInterval(() => {
for (let i = 0; i < 100000; i += 1) {
arr.push('12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890');
}
console.log('running....', arr.length);
console.log(process.memoryUsage());
}, 100);
当pm2运行时,pm2监视器显示内存恒定在49MB。显然是泄漏,但pm2未能读取正确的内存值。
我是否错误地配置了生态系统文件?这里发生了什么事