This page is Not Ready

Notice: The WebPlatform project has been discontinued when the Stewards partnership agreement ended in September 2015. This site has been frozen, and the assets we have created will remain.

performance.memory

Summary

Do not use. Proprietary. Chrome only. Gets quantized scripting memory usage numbers.

Property of apis/timingapis/timing

Syntax

Note: This property is read-only.

var memoryInfo = window.performance.memory;

Return Value

Returns an object of type ObjectObject

An object created with MemoryInfo constructor, containing jsHeapSizeLimit, totalJSHeapSize and usedJSHeapSize properties with numerical values.

Examples

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.

The values are quantized as to not expose private information to attackers. If Chrome is run with the flag `–enable-precise-memory-info` the values are not quantized.

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

Attributions

  • Microsoft Developer Network.