minimal monitor for JS Heap Size via performance.memory
JavaScript
2,088
64 commits
updated Jul 3, 2015
Like stats.js but for JS memory
@jeromeetienne, inspired by mrdoob's stats.js code, wrote this as part of tquery. I've now promoted it to a standalone repo and cleaned it all up.

--enable-precise-memory-info
stats = new MemoryStats(), add the stats.element to the DOM, and run stats.update() regularly.That might look something like:
var stats = new MemoryStats();
stats.domElement.style.position = 'fixed';
stats.domElement.style.right = '0px';
stats.domElement.style.bottom = '0px';
document.body.appendChild( stats.domElement );
requestAnimationFrame(function rAFloop(){
stats.update();
requestAnimationFrame(rAFloop);
});
Run Chrome with the flag and open demo/index.html to see it in action.
You can add this code to any page using the following bookmarklet:
javascript:(function(){var script=document.createElement('script');script.src='https://rawgit.com/paulirish/memory-stats.js/master/bookmarklet.js';document.head.appendChild(script);})()
426 followers · starred Feb 2015
9,083 followers · starred Feb 2015
3,221 followers · starred Feb 2015
578 followers · starred Jan 2021
minimal monitor for JS Heap Size via performance.memory
JavaScript
2,088
64 commits
updated Jul 3, 2015
Like stats.js but for JS memory
@jeromeetienne, inspired by mrdoob's stats.js code, wrote this as part of tquery. I've now promoted it to a standalone repo and cleaned it all up.

--enable-precise-memory-info
stats = new MemoryStats(), add the stats.element to the DOM, and run stats.update() regularly.That might look something like:
var stats = new MemoryStats();
stats.domElement.style.position = 'fixed';
stats.domElement.style.right = '0px';
stats.domElement.style.bottom = '0px';
document.body.appendChild( stats.domElement );
requestAnimationFrame(function rAFloop(){
stats.update();
requestAnimationFrame(rAFloop);
});
Run Chrome with the flag and open demo/index.html to see it in action.
You can add this code to any page using the following bookmarklet:
javascript:(function(){var script=document.createElement('script');script.src='https://rawgit.com/paulirish/memory-stats.js/master/bookmarklet.js';document.head.appendChild(script);})()
426 followers · starred Feb 2015
9,083 followers · starred Feb 2015
3,221 followers · starred Feb 2015
578 followers · starred Jan 2021