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?
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)
This question discussed there, too: https://stackoverflow.com/questions/43933951/how-to-increase-the-max-memory-limit-for-the-app-built-by-electron-builder
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?
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?