Performance/MemShrink
MemShrink is a project that aims to reduce Firefox's memory consumption. There are three potential benefits:
- Speed. Less cache pressure, less paging, and fewer/smaller GC and CC pauses.
- Stability. 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 about Firefox being a memory hog, and fewer people will complain that Mozilla ignores memory usage.
Reducing memory consumption directly helps with both stability and reputation. The effects on speed are usually murkier, and the effects depend greatly on the nature of any individual reduction and the machine Firefox is running on; changes that reduce Firefox's memory consumption but make it slower are not desirable.
There are two main facets to this:
- "Slimmer" memory usage, e.g. more space-efficient data structures.
- Avoiding "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 in certain cases).
- Bad cache algorithms and poorly tuned caches.
- Fragmentation.
Leaks are generally more important, as 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 and Progress Reports
- 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
jmuizelaar set up AWSY, inspired by AWFY.
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.
- Understanding where the time went was fairly easy, because there are good time-oriented profilers: Shark, Cachegrind, etc.
- 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; the memory profiling tools aren't as good; but most importantly, there's no well-defined goal w.r.t. any benchmarks.
A more trackable 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. Therefore, areweslimyet.com just points to the list of open MemShrink P1 bugs.