[HTML 5 Performance] Measuring used JS heap size in chrome

In this lesson we will see how to measure the used JS heap size in chrome. This can be used for various needs from performance debugging to production monitoring of apps.

 

function measureMemory() {
    console.log(`${performance.memory.usedJSHeapSize / Math.pow(1000, 2)} MB`);
}

 

posted @ 2020-03-26 18:33  Zhentiw  阅读(263)  评论(0编辑  收藏  举报