Increase JS Chrome Heap Limit?

I have a JavaScript application that uses too much memory. It does not break the tab, but it may take several minutes to load, most of which takes place in the GC. I use a heap profiler to find out which functions allocate most of the memory, which works fine.

Is there a way to get Chrome to allow a large bunch of JS for each process so that I can bypass test runs while decreasing memory pressure without waiting for minutes for the GC? A command line argument that I could not find, maybe?

+4
source share
1 answer

Yes jsHeapSizeLimit, specified in the console:

 > console.memory
  MemoryInfo {totalJSHeapSize: 42100000, usedJSHeapSize: 29400000, jsHeapSizeLimit: 1620000000}

calculated from two limits:

  size_t MaxReserved() {
    return 2 * max_semi_space_size_ + max_old_generation_size_;
  }

chromium source

( ) v8:

chromium --js-flags="--max_old_space_size=512 --max_semi_space_size=512"

( --js-flags=--help, .)

, gc , .

+3

Source: https://habr.com/ru/post/1675741/


All Articles