I’ve been on vacation, so this report covers (incompletely) the past six weeks’ worth of MemShrink improvements.
Paul Biggar and Mike Hommey enabled jemalloc on Mac 10.6. This will hopefully reduce fragmentation on that platform. And it brings it in line with Windows, Linux and Android. Now we just need it for Mac 10.5 and Mac 10.7.
Oleg Romashin found a way to drop some Thebes layers in inactive tabs in Fennec. I won’t pretend to understand the details of this bug, but if I’ve understood correctly it can saves 12MB or more per background tab.
Jeff Muizelaar turned on decode-on-draw. This means that if you open a new page in a background tab, none of its images will be decoded until you switch to that tab. Previously any images would be decoded and then discarded after 10 to 20 seconds (unless you switched to the tab before the time-out occurred). This change can save a lot of memory (and CPU time) for users browsing image-heavy sites.
Chris Leary and Jonathan “Duke” Leto made regexp compilation lazy. This potentially saves 10s or even 100s of MBs of memory in some cases by not compiling some regexps, and also allowing regexps to be GC’d more quickly. There were some possible performance regressions from this patch, it’s unclear from the bug what exactly the state of these are.
Justin Lebar converted some uses of nsTArray to nsAutoTArray (and also here). These avoided some calls to malloc (in the latter case, around 3% of all malloc calls!) and may help reduce heap fragmentation a little. Robert O’Callahan did a separate, similar nsAutoTArray change here. Justin also avoided another 1% of total malloc calls in JSAutoEnterCompartment.
A new contributor named Jiten (a.k.a. deLta30) fixed about:memory’s GC and CC buttons so they trigger collections in both the content and chrome process in Fennec. Previously only the chrome process was affected. (I’m not sure how this change will be affected by the decision to switch to the native chrome process in Fennec.) Great work, Jiten!
I avoided some wasted space in the JS code generator, and some more in the parser. Justin Lebar did something similar in nsTArray_base.
Jonathan Kew added a memory reporter for textruns and associated data. Justin Lebar added the “history-links-hashtable” memory reporter.
Brian Bondy fixed a leak in Windows drag and drop code.
Tim Taubert wrote about finding leaks in browser-chrome mochitests.
The current bug counts are as follows. The differences are against the MemShrink week 12 counts.
- P1: 37 (-3, +11)
- P2: 108 (-9, +37)
- P3: 53 (-1, +14)
- Unprioritized: 6 (-21, +5)
They’re still going up. The good news is that my gut feeling is that not many of these bugs are problems reported by users. (And those that are often are caused by add-ons.) Most of the new reports are ideas for improvements from developers.