Search code examples
firefoxmemory-managementfirefox-addonfirefox-addon-sdk

Programmatically determine memory usage of each tab in firefox?


Looking to write a firefox addon so will have access to privilaged api. I've looked through the addon-sdk, particallarly tabs, but dont see an easy way to access, have I missed something?

I noticed about:addons-memory which shows memory usage per addon which is not quite what I'm after.


Solution

  • You'll need to start with nsIMemoryReporterManager

    The memory reporter manager recently gained a .sizeOfTab() method, which might be helpful, but see the caveats about underestimating memory usage.

    Alternatively, you could parse the reports yourself using (.getReports()) and mapping the explict/window-objects/top(..., id=...) branches to tabs. The id stuff relates to the inner or outer window id, I forget which one.