Programmatically get memory usage in Chrome Programmatically get memory usage in Chrome google-chrome google-chrome

Programmatically get memory usage in Chrome


For anyone that finds this in the future, since version 20 Chrome supports window.performance.memory, which returns something like:

{  totalJSHeapSize: 21700000,  usedJSHeapSize: 13400000,  jsHeapSizeLimit: 1620000000}


An alternative approach:write a web page scraper pointing to this URL:

chrome://system/

(note: in case this URL changes again, this is the 'master' URL that lists all the chrome diagnostic pages: chrome://chrome-urls/

the page has a section 'mem_usage' that gives details of memory usage.

maybe there is some way to script Chrome as a user (say in AutoIT or Python?) that loads this URL in Chrome, and then presses the Update button, and then parses the JSON to get the memory usage for whatever tabs you are interested in.


OTHER approaches:

  • from JavaScript - use window.performance

  • from JavaScript - use browser-report.js -

https://www.npmjs.com/package/browser-report


The chrome dev channel has a process api, chrome.process. You can query it for a tab's process information, which includes all kinds of memory information. http://developer.chrome.com/extensions/processes.html