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

Issue 1695653004: Oilpan: Reduce the reserved size of CallbackStacks

Created:
4 years, 10 months ago by haraken
Modified:
4 years, 9 months ago
CC:
chromium-reviews, oilpan-reviews, Mads Ager (chromium), blink-reviews, kinuko+watch, kouhei+heap_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Oilpan: Reduce the reserved size of CallbackStacks CallbackStacks are used only while Oilpan's GC is doing marking & weak processing. However, currently each CallbackStack continues retaining one Block forever. This wastes memory a lot. Oilpan has 4 global CallbackStacks and 1 CallbackStack per thread. Each Block consumes 8192 * sizeof(Item) = 128 KB. This means that Oilpan wastes 128 KB * (4 + # of threads). When I start Chrome's new tab page, it creates 18 CallbackStacks, meaning that it wastes 128 KB * 18 = 2.3 MB of memory. This CL reduces the reserved size down to 350 KB. BUG=

Patch Set 1 #

Patch Set 2 : #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+43 lines, -29 lines) Patch
M third_party/WebKit/Source/platform/heap/CallbackStack.h View 3 chunks +6 lines, -21 lines 0 comments Download
M third_party/WebKit/Source/platform/heap/CallbackStack.cpp View 3 chunks +25 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/heap/Heap.cpp View 2 chunks +9 lines, -4 lines 1 comment Download
M third_party/WebKit/Source/platform/heap/ThreadState.cpp View 2 chunks +3 lines, -1 line 0 comments Download

Messages

Total messages: 27 (4 generated)
haraken
PTAL (Another idea would be to create a pool for Blocks, but I'm not really ...
4 years, 10 months ago (2016-02-12 05:44:53 UTC) #3
sof
I would argue that it misses the point somewhat to view these stacks as "wasted" ...
4 years, 10 months ago (2016-02-14 21:47:04 UTC) #4
haraken
On 2016/02/14 21:47:04, sof wrote: > I would argue that it misses the point somewhat ...
4 years, 10 months ago (2016-02-15 01:28:06 UTC) #5
sof
On 2016/02/15 01:28:06, haraken wrote: > ... > > FWIW, V8 pre-allocates only 256 KB ...
4 years, 10 months ago (2016-02-16 13:48:37 UTC) #6
haraken
On 2016/02/16 13:48:37, sof wrote: > On 2016/02/15 01:28:06, haraken wrote: > > > ...
4 years, 10 months ago (2016-02-22 11:38:00 UTC) #7
sof
On 2016/02/22 11:38:00, haraken wrote: > On 2016/02/16 13:48:37, sof wrote: > > On 2016/02/15 ...
4 years, 10 months ago (2016-02-22 11:39:57 UTC) #8
haraken
On 2016/02/22 11:39:57, sof wrote: > On 2016/02/22 11:38:00, haraken wrote: > > On 2016/02/16 ...
4 years, 10 months ago (2016-02-22 11:52:30 UTC) #9
sof
On 2016/02/22 11:52:30, haraken wrote: > On 2016/02/22 11:39:57, sof wrote: > > On 2016/02/22 ...
4 years, 10 months ago (2016-02-22 12:26:16 UTC) #10
haraken
On 2016/02/22 12:26:16, sof wrote: > On 2016/02/22 11:52:30, haraken wrote: > > On 2016/02/22 ...
4 years, 10 months ago (2016-02-22 13:41:57 UTC) #11
haraken
I discussed this with Jochen and Hannes. - V8 is reserving 4 MB of address ...
4 years, 10 months ago (2016-02-23 14:55:24 UTC) #13
sof
On 2016/02/23 14:55:24, haraken wrote: > I discussed this with Jochen and Hannes. > > ...
4 years, 10 months ago (2016-02-23 15:18:37 UTC) #14
haraken
On 2016/02/23 15:18:37, sof wrote: > On 2016/02/23 14:55:24, haraken wrote: > > I discussed ...
4 years, 10 months ago (2016-02-23 16:52:07 UTC) #15
haraken
Yuta-san: Would you mind applying https://codereview.chromium.org/1686943002/ and measure smoothness.tough_animation_cases on mobile? We're curious if the ...
4 years, 10 months ago (2016-02-23 20:53:18 UTC) #17
sof
On 2016/02/23 20:53:18, haraken wrote: > Yuta-san: Would you mind applying https://codereview.chromium.org/1686943002/ > and measure ...
4 years, 10 months ago (2016-02-23 21:36:25 UTC) #18
Yuta Kitamura
On 2016/02/23 20:53:18, haraken wrote: > Yuta-san: Would you mind applying https://codereview.chromium.org/1686943002/ > and measure ...
4 years, 10 months ago (2016-02-24 09:51:17 UTC) #19
haraken
On 2016/02/24 09:51:17, Yuta Kitamura wrote: > On 2016/02/23 20:53:18, haraken wrote: > > Yuta-san: ...
4 years, 10 months ago (2016-02-24 09:55:15 UTC) #20
haraken
On 2016/02/24 09:55:15, haraken wrote: > On 2016/02/24 09:51:17, Yuta Kitamura wrote: > > On ...
4 years, 10 months ago (2016-02-25 09:22:23 UTC) #21
Yuta Kitamura
On 2016/02/25 09:22:23, haraken wrote: > On 2016/02/24 09:55:15, haraken wrote: > > On 2016/02/24 ...
4 years, 10 months ago (2016-02-25 09:53:04 UTC) #22
haraken
On 2016/02/25 09:53:04, Yuta Kitamura wrote: > On 2016/02/25 09:22:23, haraken wrote: > > On ...
4 years, 10 months ago (2016-02-25 10:04:53 UTC) #23
sof
Something to consider? As Blink does most of its Oilpan allocation on the main thread, ...
4 years, 9 months ago (2016-02-29 10:08:30 UTC) #24
haraken
On 2016/02/29 10:08:30, sof wrote: > Something to consider? As Blink does most of its ...
4 years, 9 months ago (2016-02-29 10:57:34 UTC) #25
sof
On 2016/02/29 10:57:34, haraken wrote: > On 2016/02/29 10:08:30, sof wrote: > > Something to ...
4 years, 9 months ago (2016-02-29 12:22:43 UTC) #26
sof
4 years, 9 months ago (2016-02-29 13:43:58 UTC) #27
On 2016/02/29 12:22:43, sof wrote:
> On 2016/02/29 10:57:34, haraken wrote:
> > On 2016/02/29 10:08:30, sof wrote:
> > > Something to consider? As Blink does most of its Oilpan allocation on the
> main
> > > thread, the thread-local callback stack reservation for other threads
> doesn't
> > > have to be equal to the main thread's.
> > 
> > What size do you prefer? Using CallbackStack::kMinimalBlockSize?
> > 
> > (As I said before, my preference is just removing the reservations and
adding
> > RELEASE_ASSERTs about OOM but using CallbackStack::kMinimalBlockSize is also
> > fine.)
> 
> To evaluate an appropriate initial block size, you need to look at the use of
> weak collections + registerWeakMembers() off the main thread. That might be
> limited to LifecycleNotifier<>'s weak set for workers.

https://codereview.chromium.org/1750553002/ does this. With plenty of extra
room, I'm now convinced.

Powered by Google App Engine
This is Rietveld 408576698