Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

159
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda