I just landed a bunch of changes to about:memory (bug 648490, bug 653630, bug 654041, bug 655638, bug 655583). Mostly they just fix some minor problems; if you’ve seen negative numbers in about:memory since the revamp hopefully you won’t any more! (Please tell me or file a bug if you do.)
But there’s one cool new feature:
At the bottom of about:memory there are now three buttons. Here are the “title” attributes for each one, which show up as tool-tips if you hover your mouse over them, and explain what they do.
- GC: Do a global garbage collection.
- GC + CC: Do a global garbage collection followed by a cycle collection. (It currently is not possible to do a cycle collection on its own, see bug 625302.)
- Minimize memory usage: Send three “heap-minimize” notifications in a row. Each notification triggers a global garbage collection followed by a cycle collection, and causes the process to reduce memory usage in other ways, e.g. by flushing various caches.
As far as I know this is the first time users have been able to trigger GC and CC easily in a vanilla browser. It’ll be particularly useful when analyzing memory usage, e.g. trying to determine if there’s a leak. Often in that case you want to trigger a GC and/or CC to make sure that the memory stats aren’t currently inflated by dead objects, and it’s now really easy to do so.
I’ve checked all the reporters as best as I can. I’m pretty confident now that all the JS and storage (SQLite) reporters are correctly categorized as “heap” or “mapped”. I’ve looked at the others and I think they’re right, but I’m not totally certain. More specifically, the reporters in the following screenshot are currently categorized as “heap” (i.e. allocated with oe of: malloc, calloc, realloc, posix_memalign, operator new, operator new). If anyone knows that to be false, I’d love to hear about it. In particular, I’m worried about image-related memory that might be stored in video RAM; I already adjusted two reporters (gfx-2d-surfacecache and gfx-2d-surfacevram) for this reason.