Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

161
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda