Monday, May 20, 2024
61
rated 0 times [  68] [ 7]  / answers: 1 / hits: 32073  / 8 Years ago, tue, april 5, 2016, 12:00:00

Is there any limit to the heap size in the chrome memory profile ?



heap


More From » google-chrome-devtools

 Answers
114

Note: This is a Chrome only answer, see below why.




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


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



performance.memory :



A non-standard extension added in Chrome.




Linked in MDN (not anymore) : https://webplatform.github.io/docs/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 is the total amount of memory being used by JS objects including V8 internal objects, totalJsHeapSize is current size of the JS heap including free space not occupied by any JS objects. This means that usedJsHeapSize can not be greater than totalJsHeapSize. Note that it is not necessarily that there has ever been totalJsHeapSize of alive JS objects.



See the WebKit Patch for how the quantized values are exposed. The tests in particular help explain how it works.




Be careful, values are expressed without units because there isn't. This is because webkit does not want to expose system informations such as available memory size. It only provide a way to compare memory usage (for instace between two different versions of a website).


[#62686] Sunday, April 3, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tomas

Total Points: 165
Total Questions: 111
Total Answers: 103

Location: Maldives
Member since Tue, Dec 21, 2021
2 Years ago
tomas questions
Thu, Jan 27, 22, 00:00, 2 Years ago
Mon, May 10, 21, 00:00, 3 Years ago
Tue, Jan 5, 21, 00:00, 3 Years ago
;