From:  Eric Rahm <erahm@mozilla.com>
Date:  07 Nov 2015 08:07:19 Hong Kong Time
Newsgroup:  news.mozilla.org/mozilla.dev.memory
Subject:  

e10s Memory Usage w/ Multiple Content Processes

NNTP-Posting-Host:  63.245.214.181

As part of a Q4 goal I'm digging into the memory usage of Firefox w/ and w/o e10s enabled. Below I will give preliminary results for Linux.

To support this I updated AWSY to support multiple content processes and did an initial test run against a linux64 nightly from 11/3. For the memory comparison I settled on using a combination of the RSS value for the main process and the USS values for the content processes.

For example:
memory_footprint_2_content_processes = rss_main + uss_content_1 + uss_content_2

The following table gives the breakdown for the total memory consumption at each AWSY checkpoint for 0, 1, 2, 4, 8 content processes:

                     0             1            2           4            8
Start             199389184    243347456    233750528    234110976    240480256
StartSettled      181604352    230133760    226234368    229756928    223780864
TabsOpen          478851072    570781696    614490112    748322816    913575936
TabsOpenSettled   470085632    568053760    610627584    730226688    913879040
TabsOpenForceGC   434724864    534331392    587403264    702947328    860110848
TabsClosed        404824064    531988480    420941824    399577088    399527936
TabsClosedSettled 277299200    375967744    340418560    322555904    317845504
TabsClosedForceGC 253362176    337911808    318586880    298467328    294383616


As with all AWSY measurements there's a fair amount of variance b/w runs (for example a 25 MiB swing in TabsOpen is not unheard of, but that works out to about 5%).

Another way to look at this is % increase from non-e10s:

                     1       2       4       8
Start             22.05%  17.23%  17.41%  20.61%
StartSettled      26.72%  24.58%  26.52%  23.22%
TabsOpen          19.20%  28.33%  56.27%  90.78%
TabsOpenSettled   20.84%  29.90%  55.34%  94.41%
TabsOpenForceGC   22.91%  35.12%  61.70%  97.85%
TabsClosed        31.41%  3.98%   -1.30%  -1.31%
TabsClosedSettled 35.58%  22.76%  16.32%  14.62%
TabsClosedForceGC 33.37%  25.74%  17.80%  16.19%


A few loose observations:
  • There's a ~20-25% overhead right off the bat just by having 1 content process running (that's the case for Start measurements)
  • The growth is mostly sublinear
  • It actually seems like 2 content processes might have a good tradeoff. Naively we'd expect the %increase for the TabsOpen cases to double, but that's clearly not the case.
  • The more content processes that were used, the better we did on the TabsClosed metrics

I will be continuing my measurements on OSX and Windows next. Let me know of any other stats that might be useful (heap-unclassified comes to mind).

-e