ungoogled-chromium icon indicating copy to clipboard operation
ungoogled-chromium copied to clipboard

Option to increase or remove heap memory limit

Open kzhsw opened this issue 9 months ago • 2 comments

Description

Make an option, in flags or command-line, to allow users to increase or remove heap memory limit, to use heap larger than 4GB in systems with much greater memory.

Who's implementing?

  • [ ] I'm willing to implement this feature myself

The problem

Currently chrome limits the heap memory (or the memory of a render process) to likely 4GB, but larger heap would be useful for debugging heap using the memory profiler, or running large, resource-consuming app on web. This is previously discussed on many forums, but now I can not find a thing that works without rebuilding the chromium itself.

Previous contexts:

  • https://github.com/electron/electron/issues/2056
  • https://github.com/electron/electron/issues/31330
  • https://github.com/electron/electron/issues/33994
  • https://bugs.chromium.org/p/chromium/issues/detail?id=1243314#c31
  • https://bugs.chromium.org/p/chromium/issues/detail?id=1414681
  • https://bugs.chromium.org/p/chromium/issues/detail?id=416284
  • https://bugs.chromium.org/p/chromium/issues/detail?id=1347602
  • https://bugs.chromium.org/p/chromium/issues/detail?id=1081316
  • https://bugs.chromium.org/p/chromium/issues/detail?id=1289647
  • https://superuser.com/questions/1675677/error-code-out-of-memory-how-to-allocate-more-memory-to-google-chrome-64-gb
  • https://stackoverflow.com/questions/29620041/is-there-any-memory-limit-for-google-chrome-browser/
  • https://stackoverflow.com/questions/48387040/how-do-i-determine-the-correct-max-old-space-size-for-node-js
  • https://stackoverflow.com/questions/38587346/max-old-space-size-set-to-4gb-actually-limits-to-2gb
  • https://www.electronjs.org/blog/v8-memory-cage

Possible solutions

  • Make the flag --max-old-space-size and --max-semi-space-size work like in node.js
  • Make a flag to disable pointer compression (this could be a compile-time flag)
  • Get things upstreamed

Alternatives

Use Firefox which has larger limit on heap, and a slower js engine.

Additional context

No response

kzhsw avatar Nov 09 '23 05:11 kzhsw

Haven't tested it, but does this work:

chrome --js-flags="--max_old_space_size=8192"

richard-stafflink avatar Feb 25 '24 22:02 richard-stafflink

Haven't tested it, but does this work:

chrome --js-flags="--max_old_space_size=8192"

This could increase limit for ArrayBuffers, but not js objects, nor postMessage

kzhsw avatar Feb 26 '24 00:02 kzhsw