another random bit of instrumentation

Last week, I was wondering about how the frame freelist/recycling/arena behaviour might impact dynamic memory footprint, especially for long-lived pages that do a lot of DOM-whacking. So in a few hours on Friday and today I whipped up an ugly, ugly patch that tracks the total outstanding “live” frame size for a given PresShell instance, and the total size of those that are being kept on the freelist. I doubt I’ll have much time to do more with it, but it might be an interesting addition to about:memory when that gets rolling. I’d also like to make the frame counting not be debug-only, and surface that information as well, just for kicks.

[ { uri: "resource://gre/res/hiddenWindow.html", allocated: 11768, onFreelist: 212 },
{ uri: "chrome://browser/content/browser.xul", allocated: 172775, onFreelist: 15064 },
{ uri: "http://www.mozilla.org/projects/minefield/", allocated: 88944, onFreelist: 1292 },
{ uri: "http://news.google.com/", allocated: 476528, onFreelist: 2368 },
{ uri: "http://dojotoolkit.org/demos/fisheye-demo", allocated: 102379, onFreelist: 39540 },
{ uri: "http://jquery.com/plugins/project/Plugins/category/48", allocated: 166888, onFreelist: 1320 },
{ uri: "http://jquery.com/plugins/project/LavaLamp", allocated: 91904, onFreelist: 1540 },
{ uri: "chrome://global/content/console.xul", allocated: 47232, onFreelist: 313408 },
{ uri: "about:blank", allocated: 11768, onFreelist: 212 },
{ uri: "about:presshell-stats", allocated: 13620, onFreelist: 212 },
]

one comment to “another random bit of instrumentation”

  1. Steve K
    entered 15 October 2007 @ 3:25 pm

    Any way to hack in a “cpu meter” of sorts on a per-tab basis? It would be useful to have an indication on which tabs are hogging the main thread — so they can be killed!