Recommended JS Heap Memory Size

Is there a limit on heap size in a chrome memory profile?

heap profile

+7
javascript heap google-chrome-devtools
source share
2 answers

Note. . This is just the answer of Chrome, see below why.


You should take a look at window.performance.memory in Chrome Dev Tools, there is jsHeapSizeLimit attribute. However, I'm not sure if this will be the maximum value for any axis of the y profiles

You can find more information about MDN: https://developer.mozilla.org/en-US/docs/Web/API/Window/performance

performance.memory :

A custom extension has been added to Chrome.

Associated in MDN: https://docs.webplatform.org/wiki/apis/timing/properties/memory

performance.memory:

Note. This property is read-only.

 console.log(performance.memory) // Would show, for example //{ // jsHeapSizeLimit: 767557632, // totalJSHeapSize: 58054528, // usedJSHeapSize: 42930044 //} 

Notes

usedJsHeapSize - the total amount of memory used by JS objects, including V8 internal objects, totalJsHeapSize - the current JS heap size, including free space not occupied by any JS objects. This means that usedJsHeapSize cannot be greater than totalJsHeapSize. Note that it is not necessary that there is ever a totalJsHeapSize of live JS objects.

See WebKit Patch for how quantized values ​​are displayed. Tests, in particular, help explain how this works.


Be careful, values ​​are expressed without units, because they are not. This is because webkit does not want to disclose system data, such as the available memory size. This makes it possible to compare memory usage (for installation between two different versions of a website).

+3
source share

Theoretically, the memory limit (not LocalStorage, but the actual memory) is unlimited and limited by the amount of RAM in the system. In practice, most web browsers will set a limit for each window (for example, 200 MB). Sometimes the limit is customizable by the user. In addition, the operating system may limit the amount of memory used by the application.

+1
source share

All Articles