node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »



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.



  1. Start Chrome with --enable-precise-memory-info
    • Otherwise the results from performance.memory are bucketed and less useful.
  2. Include memory.stats.js
  3. Instantiate it (stats = new MemoryStats(), add the stats.element to the DOM, and run stats.update() regularly.

That might look something like:

    var stats = new MemoryStats(); = 'fixed';        = '0px';       = '0px';
    document.body.appendChild( stats.domElement );
    requestAnimationFrame(function rAFloop(){

Run Chrome with the flag and open demo/index.html to see it in action.

Framework adaptors