memory-stats.js
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.
Usage:
- Start Chrome with
--enable-precise-memory-info
- Otherwise the results from performance.memory are bucketed and less useful.
- Include memory.stats.js
- Instantiate it (
stats = new MemoryStats()
, add thestats.element
to the DOM, and runstats.update()
regularly.
That might look something like:
var stats = ; statsdomElementstyleposition = 'fixed'; statsdomElementstyleright = '0px'; statsdomElementstylebottom = '0px'; documentbody; ;
Run Chrome with the flag and open demo/index.html
to see it in action.
Framework adaptors
- Angular component by @livingobjects: https://github.com/livingobjects/angular-memory-stats
- Ember addon by @stefanpenner: https://github.com/stefanpenner/ember-browser-stats
- Rails gem by @jurre: https://github.com/jurre/memory-stats-js-rails