Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

157
Views
Electron.js CLI arguments are not passed to node.js with js-flags

I am creating an app packaged/wrapped via electron.js consisting of a node.js part and some services, and a react frontend.

  • Platform: Windows 10 prof.
  • Electron version: 19.0.0
  • node.js (embedded): 16.14.2
  • chromium (embedded): 102.0.5005.61

I am trying to make the application start with more heap space (more RAM memory assigned). But as far as goes, all efforts are not working.

Options I tried:

  • passing it as command line arguments with build electron app (e.g. myapp.exe --max-old-space-size=4096 or also --js-flags='--max-old-space-size=4096' )
  • passing it via the index.js file that creates the window (e.g. app.commandLine.appendSwitch('js-flags', '--max-old-space-size=4096'); )
  • passing it directly via the process.env (process.env["max-old-space-size]=4096)

Everything did not seem to have any effect whatsoever ! (References: https://github.com/electron/electron/issues/2056, https://warpdesign.fr/electron-development-how-to-configure-nodejs-and-runtime-chrome-flags https://www.geeksforgeeks.org/command-line-arguments-in-electronjs/ )

The memory keeps being fixed to 2 GB ( output MAX HEAP SIZE (bytes): 2132773076 ~ 1.99 GB ) Also, when outputting what is in the process.env, there is a NODE_OPTIONS: '--max-old-space-size=4096' ... so in some way it is picked up ??? But never applied to the embedded node.js.

How can I force this to increase it heap space ? I tried all suggestions. Is that broken in electron ? or am I still doing something wrong ?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!