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

Issue 301743006: Report DOM partitionAlloc size to V8 GC. (Closed)

Created:
6 years, 6 months ago by kouhei (in TOK)
Modified:
6 years, 6 months ago
CC:
abarth-chromium, arv+blink, blink-reviews, blink-reviews-bindings_chromium.org, blink-reviews-dom_chromium.org, dglazkov+blink, eae+blinkwatch, rwlbuis, sof
Visibility:
Public.

Description

Report DOM partitionAlloc size to V8 GC. Background: Currently V8GC do not have idea of DOM memory usage retained by wrappers. A small set of unreachable wrappers may retain huge DOM, but v8 gc may not be triggered as it is not aware of DOM memory usage. This CL introduces |V8GCController::reportDOMMemoryUsageToV8| - DOM memory usage is tracked at partition{Alloc,Free} - After each task run, |reportDOMMemoryUsageToV8| is called. - |reportDOMMemoryUsageToV8| notifies V8 GC the partition memory size currently consumed by DOM. After this CL, http://jsbin.com/nitobiru/18 will not crash. BUG=365018, 368406 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=176006

Patch Set 1 #

Total comments: 9

Patch Set 2 : dromaeo.com/222495 #

Patch Set 3 : force 1024 dromaeo.com/222494 #

Total comments: 1

Patch Set 4 : embed counter inside PartitionAlloc #

Patch Set 5 : undo changes on Partitions.cpp #

Total comments: 3

Patch Set 6 : track page count #

Total comments: 10

Patch Set 7 : address comments #

Total comments: 1

Patch Set 8 : add unittest / fix windows #

Unified diffs Side-by-side diffs Delta from patch set Stats (+56 lines, -10 lines) Patch
M Source/bindings/v8/V8GCController.h View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/v8/V8GCController.cpp View 1 2 3 4 5 6 7 2 chunks +15 lines, -0 lines 0 comments Download
M Source/platform/Partitions.h View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M Source/web/WebKit.cpp View 2 chunks +2 lines, -0 lines 0 comments Download
M Source/wtf/PartitionAlloc.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M Source/wtf/PartitionAlloc.cpp View 1 2 3 4 5 6 9 chunks +25 lines, -9 lines 0 comments Download
M Source/wtf/PartitionAllocTest.cpp View 1 2 3 4 5 6 7 4 chunks +6 lines, -1 line 0 comments Download

Messages

Total messages: 48 (0 generated)
kouhei (in TOK)
Would you take a look?
6 years, 6 months ago (2014-05-28 06:56:54 UTC) #1
haraken
If performance permits, I think this is a good approach. https://codereview.chromium.org/301743006/diff/1/Source/core/dom/Node.cpp File Source/core/dom/Node.cpp (right): https://codereview.chromium.org/301743006/diff/1/Source/core/dom/Node.cpp#newcode110 ...
6 years, 6 months ago (2014-05-28 07:11:33 UTC) #2
haraken
+jochen, hpayer
6 years, 6 months ago (2014-05-28 07:11:57 UTC) #3
jochen (gone - plz use gerrit)
https://codereview.chromium.org/301743006/diff/1/Source/bindings/v8/V8GCController.cpp File Source/bindings/v8/V8GCController.cpp (right): https://codereview.chromium.org/301743006/diff/1/Source/bindings/v8/V8GCController.cpp#newcode424 Source/bindings/v8/V8GCController.cpp:424: if (!isMainThread()) why? https://codereview.chromium.org/301743006/diff/1/Source/platform/Partitions.h File Source/platform/Partitions.h (right): https://codereview.chromium.org/301743006/diff/1/Source/platform/Partitions.h#newcode60 Source/platform/Partitions.h:60: ...
6 years, 6 months ago (2014-05-28 07:23:02 UTC) #4
kouhei (in TOK)
https://codereview.chromium.org/301743006/diff/1/Source/bindings/v8/V8GCController.cpp File Source/bindings/v8/V8GCController.cpp (right): https://codereview.chromium.org/301743006/diff/1/Source/bindings/v8/V8GCController.cpp#newcode424 Source/bindings/v8/V8GCController.cpp:424: if (!isMainThread()) On 2014/05/28 07:23:03, jochen wrote: > why? ...
6 years, 6 months ago (2014-05-28 07:35:20 UTC) #5
jochen (gone - plz use gerrit)
it would be nice if we could also report usage on workers. we could report ...
6 years, 6 months ago (2014-05-28 07:55:23 UTC) #6
Jens Widell
On 2014/05/28 07:55:23, jochen wrote: > we could report totalSizeOfSuperPages That has a 2 MB ...
6 years, 6 months ago (2014-05-28 08:04:41 UTC) #7
esprehn
I'm not sure this is correct, you're telling v8 about all the nodes in Shadow ...
6 years, 6 months ago (2014-05-28 08:38:13 UTC) #8
kouhei (in TOK)
Dromaeo regression is huge: (w/o patch) http://dromaeo.com/?id=222058 -> (w/patch) http://dromaeo.com/?id=222057 DOM Modification: 562.39runs/s -> 512.63runs/s ...
6 years, 6 months ago (2014-05-28 08:53:23 UTC) #9
haraken
On 2014/05/28 08:53:23, kouhei wrote: > Dromaeo regression is huge: (w/o patch) http://dromaeo.com/?id=222058 -> > ...
6 years, 6 months ago (2014-05-28 09:06:14 UTC) #10
Hannes Payer (out of office)
https://codereview.chromium.org/301743006/diff/1/Source/core/dom/Node.cpp File Source/core/dom/Node.cpp (right): https://codereview.chromium.org/301743006/diff/1/Source/core/dom/Node.cpp#newcode110 Source/core/dom/Node.cpp:110: Partitions::addDOMMemoryUsage(partitionAllocGetSize(ptr)); Is this call here causing the reported performance ...
6 years, 6 months ago (2014-05-28 11:00:06 UTC) #11
jochen (gone - plz use gerrit)
An alternative would be to add an API where v8 can query the current memory ...
6 years, 6 months ago (2014-05-28 12:00:28 UTC) #12
haraken
On 2014/05/28 12:00:28, jochen wrote: > An alternative would be to add an API where ...
6 years, 6 months ago (2014-05-28 12:05:59 UTC) #13
eseidel
I'm very exited about this change! However I'm not the right person to approve it. ...
6 years, 6 months ago (2014-05-28 22:37:53 UTC) #14
kouhei (in TOK)
I summarized the current situation on https://code.google.com/p/chromium/issues/detail?id=368406#c45 . I'd appreciate if you would comment on ...
6 years, 6 months ago (2014-05-29 03:42:32 UTC) #15
eseidel
https://codereview.chromium.org/301743006/diff/1/Source/core/dom/Node.cpp File Source/core/dom/Node.cpp (right): https://codereview.chromium.org/301743006/diff/1/Source/core/dom/Node.cpp#newcode110 Source/core/dom/Node.cpp:110: Partitions::addDOMMemoryUsage(partitionAllocGetSize(ptr)); Why would you want to report it during ...
6 years, 6 months ago (2014-05-29 05:49:48 UTC) #16
kouhei (in TOK)
On 2014/05/29 05:49:48, eseidel wrote: > https://codereview.chromium.org/301743006/diff/1/Source/core/dom/Node.cpp > File Source/core/dom/Node.cpp (right): > > https://codereview.chromium.org/301743006/diff/1/Source/core/dom/Node.cpp#newcode110 > ...
6 years, 6 months ago (2014-05-29 06:02:22 UTC) #17
kouhei (in TOK)
I tested this along with jochen's v8 patch: https://codereview.chromium.org/310393003 and it looks like we have ...
6 years, 6 months ago (2014-06-04 12:54:02 UTC) #18
haraken
On 2014/06/04 12:54:02, kouhei wrote: > I tested this along with jochen's v8 patch: > ...
6 years, 6 months ago (2014-06-04 12:58:01 UTC) #19
esprehn
Just ask PartitionAlloc for the size of the partition, you don't need all the book ...
6 years, 6 months ago (2014-06-05 01:04:26 UTC) #20
kouhei (in TOK)
On 2014/06/04 12:58:01, haraken wrote: > On 2014/06/04 12:54:02, kouhei wrote: > > I tested ...
6 years, 6 months ago (2014-06-05 02:12:48 UTC) #21
kouhei (in TOK)
On 2014/06/05 01:04:26, esprehn wrote: > Just ask PartitionAlloc for the size of the partition, ...
6 years, 6 months ago (2014-06-05 02:17:20 UTC) #22
kouhei (in TOK)
PTAL. I moved the counter to PartitionAllocRoot and I don't see regression from Dromaeo. On ...
6 years, 6 months ago (2014-06-05 04:24:08 UTC) #23
esprehn
This looks good to me, but I think you need someone like cevans or tsepez ...
6 years, 6 months ago (2014-06-05 04:34:30 UTC) #24
haraken
Looks good to me as well if PartitionAlloc guys and V8 guys like it.
6 years, 6 months ago (2014-06-05 04:49:14 UTC) #25
jochen (gone - plz use gerrit)
lgtm
6 years, 6 months ago (2014-06-05 06:54:50 UTC) #26
Hannes Payer (out of office)
lgtm
6 years, 6 months ago (2014-06-05 08:29:51 UTC) #27
kouhei (in TOK)
cevans, tsepez: Would you take a look at PartitionAlloc change? Thanks!
6 years, 6 months ago (2014-06-05 08:37:58 UTC) #28
Tom Sepez
The changes themselves LGTM, but when adding code to this routines, we have to be ...
6 years, 6 months ago (2014-06-05 17:50:52 UTC) #29
Tom Sepez
https://codereview.chromium.org/301743006/diff/80001/Source/wtf/PartitionAlloc.h File Source/wtf/PartitionAlloc.h (right): https://codereview.chromium.org/301743006/diff/80001/Source/wtf/PartitionAlloc.h#newcode509 Source/wtf/PartitionAlloc.h:509: root->totalAllocationSize -= bucketSize; nit: assert you don't underflow here.
6 years, 6 months ago (2014-06-05 17:52:01 UTC) #30
Tom Sepez
https://codereview.chromium.org/301743006/diff/80001/Source/bindings/v8/V8GCController.cpp File Source/bindings/v8/V8GCController.cpp (right): https://codereview.chromium.org/301743006/diff/80001/Source/bindings/v8/V8GCController.cpp#newcode450 Source/bindings/v8/V8GCController.cpp:450: isolate->AdjustAmountOfExternalAllocatedMemory(diff); nit: down the road, you'd probably be happier ...
6 years, 6 months ago (2014-06-05 17:58:08 UTC) #31
Chris Evans
https://codereview.chromium.org/301743006/diff/80001/Source/wtf/PartitionAlloc.h File Source/wtf/PartitionAlloc.h (right): https://codereview.chromium.org/301743006/diff/80001/Source/wtf/PartitionAlloc.h#newcode468 Source/wtf/PartitionAlloc.h:468: root->totalAllocationSize += bucket->slotSize; My gut reaction is I don't ...
6 years, 6 months ago (2014-06-05 18:00:26 UTC) #32
Chris Evans
On 2014/06/05 18:00:26, Chris Evans wrote: > https://codereview.chromium.org/301743006/diff/80001/Source/wtf/PartitionAlloc.h > File Source/wtf/PartitionAlloc.h (right): > > https://codereview.chromium.org/301743006/diff/80001/Source/wtf/PartitionAlloc.h#newcode468 ...
6 years, 6 months ago (2014-06-05 18:01:39 UTC) #33
kouhei (in TOK)
Thanks for your comments. I modified the patch to count number of non-free pages so ...
6 years, 6 months ago (2014-06-06 11:24:28 UTC) #34
Chris Evans
https://codereview.chromium.org/301743006/diff/100001/Source/platform/Partitions.h File Source/platform/Partitions.h (right): https://codereview.chromium.org/301743006/diff/100001/Source/platform/Partitions.h#newcode47 Source/platform/Partitions.h:47: static size_t currentDOMMemoryUsage() { return m_objectModelAllocator.root()->totalSizeOfNonFreePages; } I don't ...
6 years, 6 months ago (2014-06-06 18:30:50 UTC) #35
kouhei (in TOK)
PTAL. https://codereview.chromium.org/301743006/diff/100001/Source/bindings/v8/V8GCController.cpp File Source/bindings/v8/V8GCController.cpp (right): https://codereview.chromium.org/301743006/diff/100001/Source/bindings/v8/V8GCController.cpp#newcode449 Source/bindings/v8/V8GCController.cpp:449: fprintf(stderr, "currentUsage: %zu\n", currentUsage); On 2014/06/06 11:24:28, kouhei ...
6 years, 6 months ago (2014-06-09 05:48:22 UTC) #36
kouhei (in TOK)
https://codereview.chromium.org/301743006/diff/120001/Source/bindings/v8/V8GCController.cpp File Source/bindings/v8/V8GCController.cpp (right): https://codereview.chromium.org/301743006/diff/120001/Source/bindings/v8/V8GCController.cpp#newcode449 Source/bindings/v8/V8GCController.cpp:449: ssize_t diff = static_cast<ssize_t>(currentUsage) - static_cast<ssize_t>(lastUsageReportedToV8); FIXME: no ssize_t ...
6 years, 6 months ago (2014-06-09 10:13:45 UTC) #37
kouhei (in TOK)
6 years, 6 months ago (2014-06-09 10:13:47 UTC) #38
kouhei (in TOK)
6 years, 6 months ago (2014-06-09 10:13:47 UTC) #39
kouhei (in TOK)
6 years, 6 months ago (2014-06-09 10:13:47 UTC) #40
Chris Evans
On 2014/06/09 10:13:47, kouhei wrote: *Partition* LGTM -- nice and generic, and only affects the ...
6 years, 6 months ago (2014-06-09 17:11:34 UTC) #41
kouhei (in TOK)
danno, hpayer, jochen: Would you take a look? I'd like to land this change if ...
6 years, 6 months ago (2014-06-10 03:55:12 UTC) #42
jochen (gone - plz use gerrit)
lgtm
6 years, 6 months ago (2014-06-10 10:11:50 UTC) #43
Hannes Payer (out of office)
lgtm
6 years, 6 months ago (2014-06-11 13:38:10 UTC) #44
kouhei (in TOK)
I'd like to try landing this. danno: Would you comment on this if you have ...
6 years, 6 months ago (2014-06-12 07:19:08 UTC) #45
kouhei (in TOK)
The CQ bit was checked by kouhei@chromium.org
6 years, 6 months ago (2014-06-12 07:19:22 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kouhei@chromium.org/301743006/140001
6 years, 6 months ago (2014-06-12 07:20:02 UTC) #47
commit-bot: I haz the power
6 years, 6 months ago (2014-06-12 07:44:20 UTC) #48
Message was sent while issue was closed.
Change committed as 176006

Powered by Google App Engine
This is Rietveld 408576698