On Wed, Sep 30, 2009 at 10:27 PM, Mike Belshe <
mbelshe <at> google.com> wrote:
>
>
> On Wed, Sep 30, 2009 at 11:24 AM, Anton Muhin <
antonm <at> chromium.org> wrote:
>>
>> On Wed, Sep 30, 2009 at 10:17 PM, Mike Belshe <
mbelshe <at> google.com> wrote:
>> > On Wed, Sep 30, 2009 at 11:05 AM, Anton Muhin <
antonm <at> chromium.org>
>> > wrote:
>> >>
>> >> On Wed, Sep 30, 2009 at 9:58 PM, Mike Belshe <
mbelshe <at> google.com>
>> >> wrote:
>> >> > On Wed, Sep 30, 2009 at 10:48 AM, Anton Muhin <
antonm <at> google.com>
>> >> > wrote:
>> >> >>
>> >> >> On Wed, Sep 30, 2009 at 9:39 PM, Jim Roskind <
jar <at> google.com> wrote:
>> >> >> > If you're not interested in TCMalloc customization for Chromium,
>> >> >> > you
>> >> >> > should
>> >> >> > stop reading now.
>> >> >> > This post is meant to gather some discussion on a topic before I
>> >> >> > code
>> >> >> > and
>> >> >> > land a change.
>> >> >> > MOTIVATION
>> >> >> > We believe poor memory utilization is at the heart of a lot of
>> >> >> > jank
>> >> >> > problems. Such problems may be difficult to repro in short
>> >> >> > controlled
>> >> >> > benchmarks, but our users are telling us we have problems, so we
>> >> >> > know
>> >> >> > we
>> >> >> > have problems. As a result, we need to be more conservative in
>> >> >> > memory
>> >> >> > utilization and handling.
>> >> >> > SUMMARY OF CHANGE
>> >> >> > I'm thinking of changing our TCMalloc so that when a span is freed
>> >> >> > into
>> >> >> > TCMalloc's free list, and it gets coalesced with an adjacent span
>> >> >> > that
>> >> >> > is
>> >> >> > already decommitted, that the coalesced span should be entirely
>> >> >> > decommitted
>> >> >> > (as opposed to our current customized performance of committing
>> >> >> > the
>> >> >> > entire
>> >> >> > span).
>> >> >> > This proposed policy was put in place previously by Mike, but
>> >> >> > (reportedly)
>> >> >> > caused a 3-5% perf regression in V8. I believe AntonM changed
>> >> >> > that
>> >> >> > policy
>> >> >> > to what we have currently, where always ensure full commitment of
>> >> >> > a
>> >> >> > coalesced span (regaining V8 performance on a benchmark).
>> >> >>
>> >> >> The immediate question and plea. Question: how can we estimate
>> >> >> performance implications of the change? Yes, we have some internal
>> >> >> benchmarks which could be used for that (they release memory
>> >> >> heavily).
>> >> >> Anything else?
>> >> >>
>> >> >> Plea: please, do not regress DOM performance unless there are really
>> >> >> compelling reasons. And even in this case :)
>> >> >
>> >> > Anton -
>> >> > All evidence from user complaints and bug reports are that Chrome
>> >> > uses
>> >> > too
>> >> > much memory. If you load Chrome on a 1GB system, you can feel it
>> >> > yourself.
>> >> > Unfortunately, we have yet to build a reliable swapping benchmark.
>> >> > By
>> >> > allowing tcmalloc to accumulate large chunks of unused pages, we
>> >> > increase
>> >> > the chance that paging will occur on the system. But because paging
>> >> > is
>> >> > a
>> >> > system-wide activity, it can hit our various processes in
>> >> > unpredictable
>> >> > ways
>> >> > - and this leads to jank. I think the jank is worse than the
>> >> > benchmark
>> >> > win.
>> >> > I wish we had a better way to quantify the damage caused by paging.
>> >> > Jim
>> >> > and
>> >> > others are working on that.
>> >> > But it's clear to me that we're just being a memory pig for what is
>> >> > really a
>> >> > modest gain on a semi-obscure benchmark right now. Using the current
>> >> > algorithms, we have literally multi-hundred megabyte memory usage
>> >> > swings
>> >> > in
>> >> > exchange for 3% on a benchmark. Don't you agree this is the wrong
>> >> > tradeoff?
>> >> > (DOM benchmark grows to 500+MB right now; when you switch tabs it
>> >> > drops
>> >> > to
>> >> > <100MB). Other pages have been witnessed which have similar behavior
>> >> > (loading the histograms page).
>> >> > We may be able to put in some algorithms which are more aware of the
>> >> > current
>> >> > available memory going forward, but I agree with Jim that there will
>> >> > be
>> >> > a
>> >> > lot of negative effects as long as we continue to have such large
>> >> > memory
>> >> > swings.
>> >>
>> >> Mike, I am completely agree that we should reduce memory usage. On
>> >> the other hand speed was always one of Chrome trademarks. My feeling
>> >> is more committed pages in free list make us faster (but yes, there is
>> >> paging etc.). That's exactly the reason I asked for some way to
>> >> quantify quality of different approaches, esp. given classic memory
>> >> vs. speed dilemma, ideally (imho) both speed and memory usage should
>> >> be considered.
>> >
>> > The team is working on benchmarks.
>> > I think the evidence of paging is pretty overwhelming.
>> > Paging and jank is far worse than the small perf boost on dom node
>> > creation.
>> > I don't believe the benchmark in question is a significant driver of
>> > primary performance. Do you?
>>
>> To some extent. Just to make it clear: I am not insisting, if
>> consensus is we should trade performance in DOM for reduced memory
>> usage in this case, that's fine. I only want to have real numbers
>> before we make any decision.
>>
>> <at> pkasting: it wasn't 3%, it was (closer to 8% if memory serves).
>
> When I checked it in my records show a 217 -> 210 benchmark drop, which is
> 3%.