There were four main areas of MemShrink progress this week.
Killing zombie compartments
A zombie compartment is one that outlives its tab. Kyle Huey fixed a very common class of short-lived zombie compartments caused by XmlHttpRequests. These zombie compartments only lived for a couple of minutes, but this is an important fix because it makes makes memory usage follow tab usage better, and also makes detecting longer-lived zombie compartments much easier.
Alon Zakai has also been doing heroic work tracking down a zombie compartment related to web workers exhibited at coffeekup.org. I’m sure he’d appreciate additional help from anyone who might be able to provide it.
Lots of progress here.
- I changed the per-compartment memory reporters so that multiple system compartments with the same name are reported separately, instead of being merged. This made it obvious that JetPack-based add-ons can have dozens of system compartments. I don’t know if anybody realized this previously, and it’s something of a concern. The compartments are currently distinguished in about:memory only by their address, as the following example shows.
It would be great to add some identifying information that indicates what part of the code is responsible for creating each system compartment. That might even give us some much-needed per-add-on accounting.
- Andrew McCreight added a memory reporter for the cycle collector.
- I added a memory reporter for the Necko (network) memory cache.
- Justin Lebar fixed a problem with the image memory reporters, but it bounced due to a possible Tp5 RSS/PrivateBytes regression on Mac. This was surprising, maybe it was just noise?
- I changed about:memory so that if there are multiple memory reporters with the same name, you can tell they were merged into a single entry. For example, in the following screenshot you can easily tell that there were four separate connections to the places database.
Acting on memory pressure
Justin Lebar made some great progress on triggering memory pressure events when physical or virtual memory is low on Windows. See comments 28 and 29 on that bug for some nice graphs showing how this kept Firefox responsive when browsing some very image-intensive sites. This kind of adaptive behaviour is really important for getting Firefox to behave well on the full range of supported devices, from smartphones all the way up to desktop machines with lots of RAM. Go Justin!
Tweaking MemShrink processes
The MemShrink wiki page used to be vague about the project’s goals. So this week I made it more precise.
[The] goal is to get the number of MemShrink P1 bugs down to zero. That will mean that all the bad leaks will have been fixed, and also the important auxiliary work (e.g. infrastructure to detect regressions) will be in place.
As a result, Jeff Muizelaar changed areweslimyet.com to point to the list of open MemShrink P1 bugs. It previously pointed to a Tp5 Talos graph.
On a related noted, we have six open meta-bugs for tracking leaks against Firefox releases, one for tracking non-leak memory use reductions, and one for improving memory-related tools. (These are listed on the wiki.) I created these bugs before MemShrink meetings started. But now that we are using the MemShrink whiteboard annotations assiduously, these tracking bugs don’t seem necessary — having two tracking mechanisms is overkill. In particular, I think their dependencies aren’t being updated consistently. So I propose to stop using them and close them. If you have any objections, please let me know and I’ll reconsider. If I do close them, I’ll make sure that all bugs blocking them have a MemShrink annotation so they won’t fall through the cracks.
And that segues nicely into the MemShrink bug count for this week:
- P1: 26 (+2)
- P2: 49 (+0)
- P3: 33 (+4)
- Unprioritized: 6 (+4)
Like last week, this increase mostly reflects the fact that people are coming up with new ideas for improvements.