There’s been a lot of focus on B2G memory consumption in the past four weeks. Indeed, of the 38 MemShrink bugs fixed in that time, a clear majority of them relate in some way to B2G.

In particular, Justin Lebar, Kyle Huey and Andrew McCreight have done a ton of important work tracking down leaks in both Gecko and Gaia. Many of these have been reported by B2G partner companies doing stress testing such as opening and closing apps 100s or 1000s of times over long period. Some examples (including three MemShrink P1s) are here, here, here, here, here, here, here and here. There are still some P1s remaining (e.g. here, here, here). This work is painstaking and requires lots of futzing around with low-level tools such as the GC/CC logs, unfortunately.

Relatedly, Justin modified the JS memory reporter to report “notable” strings, which includes smallish strings that are duplicated many times, a case that has occurred on B2G a couple of times. Justin also moved some of the “heap-*” reports that previously lived in about:memory’s “Other measurements” section into the “explicit” tree. This makes “explicit” closer to “resident” a lot of the time, which is a useful property.

Finally, Luke Wagner greatly reduced the peak memory usage seen during parsing large asm.js examples. For the Unreal demo, this reduced the peak from 881MB to 6MB, and reduced start-up time by 1.5 seconds! Luke also slightly reduced the size of JSScript, which is one of the very common structures on the JS GC heap, thus reducing pressure on the GC heap, which is always a good thing.