node.js – NodeJS 18 PM2 process memory

Need some help:

Have 3 node services managed by PM2, first 2 (called ‘p1’ and ‘p2’) nothing special, simple as pm2 start app.js

But there is one process that requires a lot more memory and for that i have add the following:

module.exports = {
  apps: [
    {
      name: 'Engine',
      script: 'dist/scripts/pool/index.js',
        nodeArgs: [
                '--expose-gc',
                '--max-old-space-size=8192'
        ],
    },
  ],
};

But the interesting is that this one ‘engine’ which i explicity add ‘–max-old-space-size=8192’ is hte lowest HEAP SIZE on PM2, was it supposed to be 8G ? If not, how do i make sure this process has 8G alocated to it?

thank you

Read more here: Source link