{"id":13519069,"url":"https://github.com/paulirish/memory-stats.js","last_synced_at":"2025-05-15T18:04:02.099Z","repository":{"id":26130551,"uuid":"29575447","full_name":"paulirish/memory-stats.js","owner":"paulirish","description":"minimal monitor for JS Heap Size via performance.memory","archived":false,"fork":false,"pushed_at":"2015-07-03T19:31:33.000Z","size":557,"stargazers_count":2099,"open_issues_count":3,"forks_count":106,"subscribers_count":50,"default_branch":"master","last_synced_at":"2025-05-07T23:27:26.131Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paulirish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-21T06:34:33.000Z","updated_at":"2025-03-11T07:39:44.000Z","dependencies_parsed_at":"2022-07-27T06:16:21.739Z","dependency_job_id":null,"html_url":"https://github.com/paulirish/memory-stats.js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulirish%2Fmemory-stats.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulirish%2Fmemory-stats.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulirish%2Fmemory-stats.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulirish%2Fmemory-stats.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paulirish","download_url":"https://codeload.github.com/paulirish/memory-stats.js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254394720,"owners_count":22063984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T05:01:53.493Z","updated_at":"2025-05-15T18:04:02.079Z","avatar_url":"https://github.com/paulirish.png","language":"JavaScript","readme":"## memory-stats.js\n\nLike [stats.js](https://github.com/mrdoob/stats.js/) but for JS memory\n\n[@jeromeetienne](https://github.com/jeromeetienne/), inspired by mrdoob's stats.js code, wrote this as part of [tquery](https://github.com/jeromeetienne/tquery). I've now promoted it to a standalone repo and cleaned it all up.\n\n![image](http://i.imgur.com/eUCFcAH.gif)\n\n### Usage:\n\n1. Start Chrome [with](http://www.chromium.org/developers/how-tos/run-chromium-with-flags) `--enable-precise-memory-info`\n    - Otherwise the results from performance.memory are bucketed and less useful.\n1. Include memory.stats.js\n1. Instantiate it (`stats = new MemoryStats()`, add the `stats.element` to the DOM, and run `stats.update()` regularly.\n\nThat might look something like:\n\n```js\n    var stats = new MemoryStats();\n\n    stats.domElement.style.position = 'fixed';\n    stats.domElement.style.right        = '0px';\n    stats.domElement.style.bottom       = '0px';\n    \n    document.body.appendChild( stats.domElement );\n\n    requestAnimationFrame(function rAFloop(){\n        stats.update();\n        requestAnimationFrame(rAFloop);\n    });\n```\n\nRun Chrome with the flag and open `demo/index.html` to see it in action.\n\n# Framework adaptors\n\n* Angular component by [@shprink](https://github.com/shprink): https://github.com/livingobjects/angular-memory-stats\n* Ember addon by [@stefanpenner](https://github.com/stefanpenner): https://github.com/stefanpenner/ember-browser-stats\n* Rails gem by [@jurre](https://github.com/jurre):\nhttps://github.com/jurre/memory-stats-js-rails\n* Polymer element by [@ragingwind](https://github.com/ragingwind): https://github.com/ragingwind/memory-stats-element\n* Gulp plugin by [@tshaddix](https://github.com/tshaddix): https://github.com/tshaddix/gulp-memory-stats\n* Web Components element by [@jmalonzo](https://github.com/jmalonzo): https://github.com/jmalonzo/memory-stats-element\n* React Component by [@vigneshshanmugam](https://github.com/vigneshshanmugam): https://github.com/vigneshshanmugam/react-memorystats\n\n# Bookmarklet\n\nYou can add this code to any page using the following bookmarklet:\n\n```js\njavascript:(function(){var script=document.createElement('script');script.src='https://rawgit.com/paulirish/memory-stats.js/master/bookmarklet.js';document.head.appendChild(script);})()\n```\n","funding_links":[],"categories":["JavaScript","Benchmark - JavaScript"],"sub_categories":["Meetups"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulirish%2Fmemory-stats.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaulirish%2Fmemory-stats.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulirish%2Fmemory-stats.js/lists"}