Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Issue 1156863002: Oilpan: Tweak a GC threshold to consider memory increase in PartitionAlloc

Created:
5 years, 7 months ago by haraken
Modified:
5 years, 6 months ago
CC:
blink-reviews, oilpan-reviews, kouhei+heap_chromium.org, Mads Ager (chromium)
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Oilpan: Tweak a GC threshold to consider memory increase in PartitionAlloc There is a regression in peak memory usages in the memory.top_7_stress benchmark. The regression was (not all but mostly) fixed by making Oilpan consider the memory usage of PartitionAlloc (https://codereview.chromium.org/1063083002/). However, it seems that we unintentionally disabled the fix by landing https://codereview.chromium.org/1100283003/. Now we're hitting the peak memory regression again. This CL fixes the regression again. The problem is as follows: 1) The GC threshold in https://codereview.chromium.org/1063083002/ was problematic because Oilpan can trigger a GC before allocating any object on the heap. 2) https://codereview.chromium.org/1100283003/ fixed the problem by changing the GC threshold so that Oilpan doesn't trigger a GC until Oilpan allocates 1 MB of objects. 3) However, the GC threshold was problematic in another way -- if Oilpan allocates 800 KB of objects and the objects hold 30 MB of memory in PartitionAlloc, Oilpan doesn't trigger a GC and thus incrases the peak memory usage. 4) So this CL fixes the GC threshold so that: - Oilpan triggers a GC if Oilpan or/and PartitionAlloc has allocated 1 MB of objects. - But doesn't trigger a GC if the total allocated space of Oilpan is less than 1 MB. That way we can avoid the problems in both 1) and 2). We confirmed that the peak memory increase in memory.top_7_stress is (not completely but meaningfully) fixed with this CL. (The remaining regression seems to be caused by another reason, which needs more investigation.) BUG=474470 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=195891

Patch Set 1 #

Total comments: 7

Patch Set 2 : #

Patch Set 3 : #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -12 lines) Patch
M Source/platform/heap/ThreadState.cpp View 1 2 3 chunks +10 lines, -12 lines 1 comment Download

Messages

Total messages: 37 (2 generated)
haraken
Sigbjornf: PTAL. If you have no objection, I might want to land this. yutak@ confirmed ...
5 years, 7 months ago (2015-05-25 09:30:59 UTC) #2
sof
Thanks for the clear & detailed description. I think it is fine to impose a ...
5 years, 7 months ago (2015-05-25 21:37:51 UTC) #3
haraken
https://codereview.chromium.org/1156863002/diff/1/Source/platform/heap/ThreadState.cpp File Source/platform/heap/ThreadState.cpp (right): https://codereview.chromium.org/1156863002/diff/1/Source/platform/heap/ThreadState.cpp#newcode519 Source/platform/heap/ThreadState.cpp:519: && currentObjectSize >= 1024 * 1024 // Oilpan or/and ...
5 years, 7 months ago (2015-05-25 23:31:53 UTC) #4
sof
lgtm to go ahead with this; it does run the risk of GCing rather quickly ...
5 years, 7 months ago (2015-05-26 05:10:59 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1156863002/1
5 years, 7 months ago (2015-05-26 05:13:09 UTC) #7
commit-bot: I haz the power
Committed patchset #1 (id:1) as https://src.chromium.org/viewvc/blink?view=rev&revision=195891
5 years, 7 months ago (2015-05-26 06:29:31 UTC) #8
sof
On 2015/05/26 05:10:59, sof wrote: > lgtm to go ahead with this; it does run ...
5 years, 7 months ago (2015-05-26 19:08:32 UTC) #9
sof
https://codereview.chromium.org/1156863002/diff/1/Source/platform/heap/ThreadState.cpp File Source/platform/heap/ThreadState.cpp (right): https://codereview.chromium.org/1156863002/diff/1/Source/platform/heap/ThreadState.cpp#newcode544 Source/platform/heap/ThreadState.cpp:544: && currentObjectSize >= 1024 * 1024 // Oilpan or/and ...
5 years, 7 months ago (2015-05-26 19:25:37 UTC) #10
haraken
yuta-san: Would you re-confirm that the peak memory usage is (partially) gone with this CL? ...
5 years, 7 months ago (2015-05-27 00:39:01 UTC) #11
sof
https://codereview.chromium.org/1156863002/diff/1/Source/platform/heap/ThreadState.cpp File Source/platform/heap/ThreadState.cpp (right): https://codereview.chromium.org/1156863002/diff/1/Source/platform/heap/ThreadState.cpp#newcode544 Source/platform/heap/ThreadState.cpp:544: && currentObjectSize >= 1024 * 1024 // Oilpan or/and ...
5 years, 7 months ago (2015-05-27 05:09:07 UTC) #12
haraken
(Either way, I'll wait for yutak's investigation before taking next actions.) https://codereview.chromium.org/1156863002/diff/1/Source/platform/heap/ThreadState.cpp File Source/platform/heap/ThreadState.cpp (right): ...
5 years, 7 months ago (2015-05-27 05:50:03 UTC) #13
sof
On 2015/05/27 05:50:03, haraken wrote: > (Either way, I'll wait for yutak's investigation before taking ...
5 years, 7 months ago (2015-05-27 05:57:28 UTC) #14
haraken
On 2015/05/27 05:57:28, sof wrote: > On 2015/05/27 05:50:03, haraken wrote: > > (Either way, ...
5 years, 7 months ago (2015-05-27 05:59:45 UTC) #15
sof1
On Wed, May 27, 2015 at 7:59 AM, <haraken@chromium.org> wrote: > .... > > >> ...
5 years, 6 months ago (2015-05-27 21:47:02 UTC) #16
haraken
On 2015/05/27 21:47:02, sof1 wrote: > On Wed, May 27, 2015 at 7:59 AM, <mailto:haraken@chromium.org> ...
5 years, 6 months ago (2015-05-28 01:33:36 UTC) #17
haraken
Updated the CL. yuta-san: Would you confirm if this CL (partially) fixes the peak memory ...
5 years, 6 months ago (2015-05-28 02:30:45 UTC) #18
haraken
On 2015/05/28 02:30:45, haraken wrote: > Updated the CL. > > yuta-san: Would you confirm ...
5 years, 6 months ago (2015-06-04 04:33:00 UTC) #19
Yuta Kitamura
On 2015/06/04 04:33:00, haraken wrote: > yuta-san: Can you put your data on memory.top_7_stress here? ...
5 years, 6 months ago (2015-06-04 05:09:29 UTC) #20
haraken
On 2015/06/04 05:09:29, Yuta Kitamura wrote: > On 2015/06/04 04:33:00, haraken wrote: > > yuta-san: ...
5 years, 6 months ago (2015-06-04 05:19:32 UTC) #21
sof
On 2015/06/04 05:19:32, haraken wrote: > On 2015/06/04 05:09:29, Yuta Kitamura wrote: > > On ...
5 years, 6 months ago (2015-06-04 08:15:27 UTC) #22
haraken
On 2015/06/04 08:15:27, sof wrote: > On 2015/06/04 05:19:32, haraken wrote: > > On 2015/06/04 ...
5 years, 6 months ago (2015-06-09 11:07:31 UTC) #23
sof
On 2015/06/09 11:07:31, haraken wrote: > On 2015/06/04 08:15:27, sof wrote: > > On 2015/06/04 ...
5 years, 6 months ago (2015-06-09 11:59:50 UTC) #24
haraken
On 2015/06/09 11:59:50, sof wrote: > On 2015/06/09 11:07:31, haraken wrote: > > On 2015/06/04 ...
5 years, 6 months ago (2015-06-09 12:19:17 UTC) #25
sof
On 2015/06/09 12:19:17, haraken wrote: > On 2015/06/09 11:59:50, sof wrote: > > On 2015/06/09 ...
5 years, 6 months ago (2015-06-09 12:29:46 UTC) #26
sof
After having poked at this a bit, I wonder if the near-OOM handling that triggers ...
5 years, 6 months ago (2015-06-09 15:49:56 UTC) #27
sof
On 2015/06/09 15:49:56, sof wrote: > After having poked at this a bit, I wonder ...
5 years, 6 months ago (2015-06-09 21:49:07 UTC) #28
haraken
On 2015/06/09 21:49:07, sof wrote: > On 2015/06/09 15:49:56, sof wrote: > > After having ...
5 years, 6 months ago (2015-06-10 01:50:50 UTC) #29
haraken
On 2015/06/10 01:50:50, haraken wrote: > On 2015/06/09 21:49:07, sof wrote: > > On 2015/06/09 ...
5 years, 6 months ago (2015-06-10 04:56:14 UTC) #30
sof
On 2015/06/10 04:56:14, haraken wrote: > On 2015/06/10 01:50:50, haraken wrote: > > On 2015/06/09 ...
5 years, 6 months ago (2015-06-10 06:50:25 UTC) #31
sof
On 2015/06/10 01:50:50, haraken wrote: > On 2015/06/09 21:49:07, sof wrote: > ... > > ...
5 years, 6 months ago (2015-06-10 07:23:33 UTC) #32
Yuta Kitamura
Re: dom-modify.html structure, The outer loop doesn't enclose the test functions below (note the missing ...
5 years, 6 months ago (2015-06-10 07:24:42 UTC) #33
sof
On 2015/06/10 07:23:33, sof wrote: > On 2015/06/10 01:50:50, haraken wrote: > > On 2015/06/09 ...
5 years, 6 months ago (2015-06-10 07:51:38 UTC) #34
haraken
> The other way around? Aggressively reducing the estimate will delay GCs. I still think ...
5 years, 6 months ago (2015-06-10 08:16:01 UTC) #35
sof
On 2015/06/10 08:16:01, haraken wrote: > > The other way around? Aggressively reducing the estimate ...
5 years, 6 months ago (2015-06-10 10:49:10 UTC) #36
sof
5 years, 6 months ago (2015-06-10 21:52:43 UTC) #37
On 2015/06/10 07:51:38, sof wrote:
> On 2015/06/10 07:23:33, sof wrote:
> > On 2015/06/10 01:50:50, haraken wrote:
> > > On 2015/06/09 21:49:07, sof wrote:
> > >
> > ...
> > > 
> > > >  - serious amount of allocation under-reporting; upon OOM, I see 2.5G of
> > > > committed memory, but ~300M of recorded allocations across Oilpan and
PA.
> > > 
> > > Does this mean that currentObjectSize in shouldForceConservativeGC is 300
MB
> > > whereas you observe 2.5 GB of committed memory in the OS?
> > > 
> > 
> > Yes, 2.5G of committed memory (as reported by vmmap on a Release binary once
> OOM
> > has struck). PA has ~120M of reported allocations at that point, so someone
is
> > either under-reporting or another allocator is claiming a lot.
> > 
> > Regarding accurately reporting allocations, isn't some of that missing from
> > NormalPageHeap::expandObject() (and shrinkObject())?
> > 
> > > >  - The PA super pages allocation size is about 50% larger than the
> committed
> > > > page size
> > > 
> > > This might make sense. PA allocates super pages very aggressively (which
is
> > > another issue).
> > 
> > It's not unbearable in this case; just wanted to verify that there wasn't
> > something pathological going on.
> > 
> > > 
> > > >  - Oilpan allocated space is continuously growing, despite the live
object
> > > size
> > > > fluctuating across GCs.
> > > 
> > > Does this mean that we have a fragmentation in the heap?
> > > 
> > 
> > I need to spend my time/days on matters other than Oilpan, so will not be
able
> > to investigate this, but let me make available in a spreadsheet the sequence
> of
> > values that shouldForceConservativeGC() works over.
> 
> Not too interesting bundle of raw data, but
> 
> 
>
https://docs.google.com/spreadsheets/d/1h7QCUl1-g40MgWIUSDjuo26X3G4zlGpKZiP4z...
> 
> shows how the amounts evolve.

That log stops where it gets interesting, but no Oilpan GCs end up being run (or
checked for). A series of major v8 GCs do go ahead though as the memory pressure
increases rapidly until OOM hits.

https://codereview.chromium.org/1174123002/ addresses & explains.

Powered by Google App Engine
This is Rietveld 408576698