It’s been six months since MemShrink started! Here are this week’s events of note.
I integrated DMD support into Firefox. This is a big deal because DMD is crucial for improving the coverage and correctness of memory reporters. There are several consequences of this.
- You no longer need to apply a patch to Firefox if you want to use DMD, you just have to configure with
--enable-dmd. (Full instructions are here.)
- Any memory reporter written in the new style (i.e. using a
nsMallocSizeOfFunfunction created with
NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN) will automatically get coverage in DMD.
- DMD finds bugs in memory reporters, but it can also find bugs elsewhere. For example, this week it found that some BaseShapes were being shared incorrectly, which Brian Hackett fixed.
I updated the layout memory reporters to use the new style. I also updated the documentation on writing memory reporters, to cover more complicated topics like how to measure classes that involve inheritance. I also added a request: if you write a memory reporter, please add me as a co-reviewer.
Johnny Stenback implemented per-window DOM memory reporters, which gives much more detail for DOM memory usage in about:memory. Here’s an example:
Memory Usage Improvements
Boris Zbarsky lazily initialized some rulehash tables, saving about 45KB per blank tab; this is a nice win for those people who have on-demand tab loading combined with sessions with many tabs. The same patch also made one of the rulehash tables smaller when it is initialized, which can cause multi-MB savings on workloads of only a few tabs.
Bobby Holley fixed a bad memory leak in xpconnect that could cause unbounded amounts of memory to be leaked, albeit in somewhat unusual circumstances. The bug was only in Firefox 9 and Firefox 10; it’s been fixed for 10, and the patches to fix for 9 are ready to land.
Fabrice Desré fixed a regression that caused a zombie compartment when visiting addons.mozilla.org.
Here are the current bug counts.
- P1: 27 (-1/+1)
- P2: 139 (-5/+3)
- P3: 62 (-0/+2)
- Unprioritized: 1 (-0/+1)
That’s a net change of +1, and we only had to triage seven bugs in today’s meeting. And if the trees hadn’t been closed for the past few days I could have fixed two more P2 bugs.
Just for fun, I also counted the number of RESOLVED FIXED (i.e. genuine, not duplicates or invalid) MemShrink bugs.
- P1: 29
- P2: 70
- P3: 14
- Unprioritized: 35
(If you’re wondering why the number of unprioritized fixed bugs is so high, it’s because MemShrink bugs are only prioritized in MemShrink meetings, which means that any bug that gets filed and fixed in less than 7 days doesn’t get prioritized.)
So there are more bugs still open than have been fixed, but the rate of bug growth is close to zero.