Performance/MemShrink
MemShrink is a project that aims to reduce Firefox's memory consumption. There are three potential benefits.
- Speed. Firefox will be faster due to less cache pressure, less paging, and fewer/smaller GC and CC pauses. Changes that reduce memory consumption but make Firefox slower are not desirable.
- Stability. Firefox will suffer fewer aborts/crashes due to virtual or physical memory exhaustion. The former is mostly a problem on 32-bit Windows builds with a 2GB or 4GB virtual memory limit, the latter is mostly a problem on mobile devices that lack swap space.
- Reputation. Fewer people will complain that Firefox is a memory hog and that Mozilla ignores memory usage.
This blog post describes these benefits in more detail.
There are two main ways to reduce memory consumption.
- "Slim down" memory usage, e.g. make data structures more space-efficient.
- Avoid "leaks". This loose use of the term (which is used throughout this document) includes:
- True leaks, where memory is lost forever.
- Lifetime issues, where memory is not reclaimed until you close the page/tab/window/process.
- Collection heuristic issues (e.g. GC is too infrequent).
- Bad cache algorithms and poorly tuned caches.
- Fragmentation.
Leaks are generally more important, because they are more likely to lead to horrible performance.
Meetings
Meetings will happen every Tuesday at 2pm Pacific time.
- Dial-in: Audio-only conference# 95346
- People with Mozilla phones or softphones please dial x4000 Conf# 95346
- US/Toll-free: +1 800 707 2533, (pin 4000) Conf# 95346
- US/California/Mountain View: +1 650 903 0800, x4000 Conf# 95346
- US/California/San Francisco: +1 415 762 5700, x4000 Conf# 95346
- US/Oregon/Portland: +1 971 544 8000, x4000 Conf# 95346
- CA/British Columbia/Vancouver: +1 778 785 1540, x4000 Conf# 95346
- CA/Ontario/Toronto: +1 416 848 3114, x4000 Conf# 95346
- UK/London: +44 (0)207 855 3000, x4000 Conf# 95346
- FR/Paris: +33 1 84 88 37 37, x4000 Conf# 95346
- Gmail Chat (requires Flash and the Google Talk plugin): paste +1 650 903 0800 into the Gmail Chat box that doesn't look like it accepts phone numbers
- SkypeOut is free if you use the 800 number
- Vidyo: PB&J
- IRC: #memshrink
- Etherpad: memshrink (copied to wiki after the meeting)
Ideally, these weekly meetings would only be needed for a medium length of time, say 1 or 2 quarters. Hopefully after that, things will have improved enough that meetings could be less frequent (bi-weekly or monthly) or not needed at all.
Minutes, Progress Reports and Presentations
- 2012-02-21 (no minutes taken); Week 36 report
- 2012-02-14 (no minutes taken); Week 35 report
- 2012-02-07 (no minutes taken); Week 34 report
- 2012-01-31 (no minutes taken); Week 33 report
- 2012-01-24 (no minutes taken); Week 32 report
- 2012-01-17 (no minutes taken); Week 31 report
- 2012-01-16 "Notes on Reducing Firefox's Memory Consumption", presented at linux.conf.au Browser MiniConf
- 2012-01-10 (no minutes taken); Week 30 report
- 2012-01-03 (no minutes taken); Weeks 28--29 report
- 2011-12-27 (no meeting); (no weekly report)
- 2011-12-20 (no minutes taken); Week 27 report
- 2011-12-13 minutes; Week 26 report
- 2011-12-06 minutes; Week 25 report
- 2011-11-29 minutes; Week 24 report
- 2011-11-22 (no minutes taken); Week 23 report
- 2011-11-15 (no minutes taken); Week 22 report
- 2011-11-08 minutes; Week 21 report
- 2011-11-01 minutes; Week 20 report
- 2011-10-25 minutes; Week 19 report
- 2011-10-18 minutes; Weeks 13--18 report
- 2011-10-11 minutes; (no weekly report)
- 2011-10-04 minutes; (no weekly report)
- 2011-09-27 (no minutes taken); (no weekly report)
- 2011-09-20 minutes; (no weekly report)
- 2011-09-13 (no minutes taken); (no weekly report)
- 2011-09-06 minutes; Week 12 report
- 2011-08-30 minutes; Week 11 report
- 2011-08-23 minutes; Week 10 report
- 2011-08-16 minutes; Week 9 report
- 2011-08-09 minutes; Week 8 report
- 2011-08-02 (no minutes taken); Week 7 report
- 2011-07-26 minutes; Week 6 report
- 2011-07-19 minutes; Week 5 report
- 2011-07-12 minutes; Week 4 report
- 2011-07-05 minutes; Week 3 report
- 2011-06-28 (no minutes taken); Week 2 report
- 2011-06-21 (no minutes taken); Week 1 report
- 2011-06-14 (no minutes taken)
Bug Tracking
Bugs tracked by the MemShrink project are prioritized by adding one of "MemShrink:P1", "MemShrink:P2" or "MemShrink:P3" to the whiteboard.
- Unprioritized MemShrink bugs. These are triaged regularly in meetings.
- MemShrink:P1 bugs. These are discussed regularly in meetings.
- MemShrink:P2 bugs. These are discussed occasionally in meetings. P2 is the default priority.
- MemShrink:P3 bugs. These are discussed rarely in meetings.
Some other interesting bug lists.
- All MemShrink bugs.
- Unconfirmed MemShrink bugs. These are problems reported by users and generally require some kind of additional work to confirm.
- MemShrink bugs with a "mentor" annotation. These are bugs that someone has identified as reasonable easy, and that person is willing to help a newcomer fix the bug.
- Unassigned MemShrink bugs. These need someone to work on them.
There's also a tracking bug for bugs relating to profiling, tools and infrastructure. (These bugs overlap several of the above lists.)
areweslimyet.com
AWFY was a very successful site used to track the performance of Firefox's JavaScript engine.
Why was AWFY so successful? Some key characteristics.
- The benchmarks were easy to choose: everybody already used SS and V8, and then Mozilla released Kraken. They run quickly, too, which is nice for devs, and allows expensive tools (like Cachegrind) to be used.
- The metrics were easy to choose. SS time, V8 time, Kraken time. They can be measured easily, precisely, and fairly repeatably. You can break the total time down into per-benchmark times, which really helps with understanding improvements and regressions. They're easy for devs to run on their own machine.
- There was a well-defined goal: match or beat the other browsers.
In comparison, for AWSY there is no good and/or standard benchmark suite; metrics are less clear and/or harder to measure; and most importantly, there's no well-defined goal w.r.t. any benchmarks.
Nonetheless, we've created a memory benchmark and are tracking Firefox's performance on it over time, to provide a sense of MemShrink progress and detect regressions. It is available at AWSY, inspired by