The big news this week is the landing of the native version of DMD. The old version of DMD is a Valgrind-based tool that has been instrumental in reducing the size of about:memory’s “heap-unclassified”. (For example, with trunk builds on my Linux desktop machine it’s now frequently less than 10%.)
However, the old version of DMD wasn’t easy to run. For example, it required patching Valgrind’s source code and re-building it, among other things. As a result, only a handful of people ever ran it. Furthermore, because it’s a Valgrind tool it is very slow and will never run on Windows.
In contrast, the new version is much easier to use. It just requires a slight configuration change at build time and a slight change in how the browser is invoked.
It’s also much faster, especially if you use the sampling mode which trades a small amount of precision for a great deal of speed. Crucially, this means it is usable on B2G. Also, it should be possible for people to use it for long-running sessions, which can be helpful for identifying slow leaks.
And while the new version doesn’t currently run on Windows, it should be fairly straightforward to get it working. If anyone is interested in helping with this, please contact me, or take a look at the open bug.
I will write a more detailed post about the new version some time in the next few days, once I have updated the documentation and finalized a few more tweaks that should improve usability. In the meantime, Justin Lebar is already using it in earnest to better understand B2G’s memory consumpion (e.g. see here, here, here, here, here, here, here).
Thanks to Mike Hommey for his excellent replace-malloc infrastructure, on which the new version is built, and to Justin for lots of help, especially with Android and B2G details.
The option that allows B2G to merge system compartments, previously implemented and landed by Kyle Huey, was enabled by default. This is a big deal, because it’s the single biggest memory consumption improvement B2G has seen and is likely to see before version 1 is released.
Gabriel Svelto reduced the number of unused dirty pages kept around by jemalloc on B2G. This can save ~4 MiB of memory across all processes, at a potential cost of making some allocations a little slower. On a device as memory-constrained as the B2G phones, this is a good trade-off.
Felipe Gomes reduced the memory consumption of the social API when multiple browser windows are open. This change has been backported to the beta channel, so it will be present in Firefox 18, in time for the bigger publicity push for this feature. (For those of you that don’t like Facebook, please note that if you don’t enable the social API it will not affect Firefox’s performance in any way.)
I added a MEMORY_VSIZE telemetry reporters, which measures virtual memory consumption. This might help us understand how many Windows users would benefit from 64-bit builds.
Here are the current bug counts.
- P1: 17 (-3/+3)
- P2: 126 (-2/+14)
- P3: 106 (-4/+7)
- Unprioritized: 0 (-2/+0)