question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

--options max_old_space_size can not run in cluster mode

See original GitHub issue

such as : file FCSAppCluster376.js include : const cluster = require(‘cluster’); if (cluster.isMaster) { console.log(Master ${process.pid} is running); var prc=cluster.fork(); … } else { require(‘./FCSApp.js’); console.log(Worker ${process.pid} started); }

pkg -t win -c ./config.json ./FCSAppCluster376.js --options max_old_space_size=4096

when run FCSAppCluster376.exe report err: Error: Cannot find module ‘E:\Code\nodejs\EDC376\FCSNode376--max_old_space_size=4096’ at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15) at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1287:46) at Function.Module._load (internal/modules/cjs/loader.js:506:25) at Function.Module.runMain (pkg/prelude/bootstrap.js:1316:12) at startup (internal/bootstrap/node.js:320:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:659:3) worker 7048 died.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
PascalPuchtlercommented, Aug 23, 2019

I have a smal work around. With this it is not possible to configurate the max_old_space_size from a worker, but the max_old_space_size from the master.

I used:

const cluster = require('cluster');
cluster.setupMaster({
      exec: __dirname + '/Worker.js',
      execArgv: []
    });
let worker = cluster.fork();
0reactions
lamualfacommented, Oct 27, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I determine the correct "max-old-space-size" for Node ...
js acts based on the parameter max-old-space-size . In my case, for example, I'm running two t2.small AWS instances (2GB of RAM). Not...
Read more >
Command-line API | Node.js v19.3.0 Documentation
These options expose built-in debugging, multiple ways to execute scripts, ... If the string is not an absolute path, it's resolved as a...
Read more >
Memory Limit Reload - PM2
In cluster mode, the reload is done on each instance that exceeds the memory limit. The limitation does not apply on the total...
Read more >
max-old-space-size=8192 - You.com | The AI Search Engine ...
Now, if setting environment variable is not a preferred option, one can always use --max-old-space-size either while running the node command.
Read more >
Out of memory crash on Windows 10 PC - Node-RED Forum
... this is worth a try: C:\Users\tbg>node --max-old-space-size=81928 red.js --userDir ... This does not run and throws the following error:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found