Fission MemShrink Newsletter #2

Eric Rahm erahm at
Thu Aug 16 19:41:29 UTC 2018

Hi Folks!

The Fission MemShrink project has been chugging along quite nicely and a
ton of progress has been made over the past month. There's been a large
focus on reducing the JS memory usage and we've managed to drop the base
content JS measure
by ~1.1MB (17%) [1]:


Additionally we've started looking at the overhead of our many threads
<> [2], drafted up some
ideas on reducing relocation overhead by adopting a fork server
<> on linux/mac [3],
and we're looking at reducing the overhead of per process font related data
<> [4].

Below is a sampling of the bugs that have improved memory usage over the
past month, apologies if I left any off! Please feel free to point out
other improvements. All numbers are *per content process*.

*JS improvements*

   - In a great example of every little bit counts, *Kris Maglione* reduced
   memory usage by *405KB* in various bugs that made us lazily load JS
   content (Bug 1472491
   <>, Bug 1473631
   <>, Bug 1474139
   <>, Bug 1474155
   <>, Bug 1479241
   <>, Bug 1479245
   <>, Bug 1479309
   <>, Bug 1479310
   <>, Bug 1479312
   <>, Bug 1479313
   <>, Bug 1479318
   <>, Bug 1480319
   <>, Bug 1480327
   <>, Bug 1483363
   - Kris also reduced memory usage by *494KB* by getting rid of
   MessageManager globals (Bug 1480244
   - *Felipe Gomes* reduced memory usage by *95KB* by lazily loading JS
   content (Bug 1369466
   <>, Bug 1470324
   - *Mike Kaply* reduced memory usage by *65KB* by converting an add-on to
   in tree telemetry (Bug 1475571
   - *Dão Gottwald* reduced memory uasge by *57KB* by lazily generating
   thumbnails for the Ctrl+Tab panel (Bug 1481321
   - *Nick Nethercote* reduced memory usage by *44KB* by making
   mozilla::HashMaps lazily allocate their storage (Bug 1481998
   - *Benjamin Bouvier* reduced memory usage by *25KB* by removing SIMD.js (Bug
   1416723 <>)

*Threading Overhead*

   - Kris added measurements for thread stacks across platforms (Bug 1475899
   <>, Bug 1476405
   <>, Bug 1477512)
   - Kris reduced memory usage on Linux by *~3MB* (that's megabytes!) by
   changing our default stack size (Bug 1476828
   - *Eric Rahm* (this author) reduced memory usage by *50KB* by reducing
   the amount of networking threads (Bug 1448034
   - *Xidorn Quan* committed an upstream Rust patch (rust-lang/rust#52847
   <>) to fix how stack sizes
   are set on windows after Kris' initial investigation (Bug 1479250

*Font Overhead*

   - The winner of biggest improvement with the smallest change goes to *Lee
   Salzman* who reduced memory usage on OSX by *10MB* by reducing the skia
   glyph cache (Bug 1258781

*Lessons learned*

Small fixes add up, removing dead code not only helps code quality but can
save memory, adding measurements is important, caches can be easy targets.
If you know of a cache we might tweak please file a bug to consider
reducing it.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the firefox-dev mailing list