Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to increase the max memory limit? #1541

Closed
jues-zz opened this issue May 12, 2017 · 6 comments
Closed

How to increase the max memory limit? #1541

jues-zz opened this issue May 12, 2017 · 6 comments
Labels

Comments

@jues-zz
Copy link

jues-zz commented May 12, 2017

  • 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?

@develar
Copy link
Member

develar commented May 12, 2017

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

@jues-zz
Copy link
Author

jues-zz commented May 12, 2017

@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?

@loopmode
Copy link

loopmode commented Oct 6, 2017

@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)

@kikill95
Copy link

@Hadatko
Copy link

Hadatko commented Jan 22, 2019

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 :/

@loopmode
Copy link

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants