On Chrome and Chromium OS, the memory limit is determined by the browser, and you can check the limit with the following command in the developer tools command line by pressing F12:
> window.performance.memory.jsHeapSizeLimit 1090519040
On my Windows 10 OS, it's about 1 GB.
In Chrom (e / ium), you can get around the heap size limit by allocating your own arrays:
var target = [] while (true) { target.push(new Uint8Array(1024 * 1024));
This causes the tab to crash about 2 GB, which happens very quickly. After that, Chrom (e / ium) fails, and it is impossible to repeat the test without restarting the browser.
I also recommend reading the TrackJS blog on JavaScript memory monitoring before delving into the weeds, trying to diagnose or measure anything related to the browser.
You can also find javascript memory limit in comp.lang.javascript.
See also these messages:
The maximum array size in Javascript , which assumes you can store up to 2 32 -1 = 4 294 967 295 = 4.29 billion elements.
The maximum number of arguments that a JavaScript function can accept.
The JS9 Astronomical Image Display Library website has more information: working with memory limitations .
(I tried to find a good answer, and the answer “no upper limit” given here was simply stupid for me. I cannot run into a production problem for a multi-million dollar project and say to the management: “Well, I assumed that there is no upper limit, and everything will be okay. "Try checking the concept, for example, loading a lot of list controls into the selected JavaScript UI, etc. You may find that your environment has some performance degradation .)
Here are some of the components that I found very scalable in terms of processor performance and memory performance:
- Microsoft Monaco Editor
- This is used by several commercial projects:
- Postman, from v7.1.1-canary08
- Code VS
Here are some examples of platforms with known performance degradation:
- Corner: Poor approach to detecting changes.
- For each asynchronous event, compare each binding (Model-Dom binding) to its old value to decide whether to re-render.
- NG1:> 2500 viewers, performance stops
- NG2: the same problem remains, but you have a long tedious workaround: switch to immutable and distribute ChangeDetectionStrategy.on Swipe throughout the application to disable the default problematic strategy
- to react
- Again, immutable collections of JS objects are so far only scalable.
- A create-responsive application using Immutable.JS and Immutable.JS internally can only create about 500 thousand immutable collections before it dies.
Here are a few more things to consider:
- Use array.slice to manipulate arrays to minimize additional array allocations; array.slice will change the array in place, which will reduce garbage collection and overall heap size.
John Zabroski Aug 28 '12 at 16:28 2012-08-28 16:28
source share