Electron-builder: How to increase the max memory limit?

Created on 12 May 2017  路  6Comments  路  Source: electron-userland/electron-builder


  • Version: "electron": "1.6.2", "electron-builder": "^16.8.2",

  • Target: windows x64



Hi, I'm trying to load a 50M datasheet and parse. The js program takes 2g ram to run in Chrome. In V8 the max memory is limited to ~1.6g, how could I increase that when building the app?

question

Most helpful comment

@develar I know I can add --js-flags="--max-old-space-size=4096" when run it using electron. But Where should I put this param to the build config of electron-builder?

All 6 comments

Please ask in the Electron community, this question not related to electron-builder.

@develar I know I can add --js-flags="--max-old-space-size=4096" when run it using electron. But Where should I put this param to the build config of electron-builder?

@jues in our case, we are using electron-webpack which in term calls electron-builder.

The original code script was: "dist": "yarn compile && electron-builder",
And we were crashing due to out-of-memory during wbepack compilation.

We solved the problem by changing to "dist": "cross-env NODE_OPTIONS='--max-old-space-size=8192' yarn compile && electron-builder"

So, the trick is to simply set the NODE_OPTIONS before executing whatever you are doing (via export NODE_OPTIONS or set NODE_OPTIONS depending on your operating system, or via cross-env as we did)

Hi,
i have same issue and i tried steps you suggested with "dist": "cross-env NODE_OPTIONS='--max-old-space-size=8192' yarn compile && electron-builder"

But it is not working for me. Lets assume i have everything up-to-date, stable. Is there any chance to increase memory usage? I need at least 8GB but app taken 2GB :/

@Hadatko note that my solution only increased the memory during the compile step, not sure if the same is possible for the electron-builder step (after &&). Do you know for sure whether the problem is in yarn compile or electron-builder?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

antonycourtney picture antonycourtney  路  3Comments

talarari picture talarari  路  3Comments

popod picture popod  路  3Comments

StickNitro picture StickNitro  路  3Comments

AidanNichol picture AidanNichol  路  3Comments