New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 718484 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

GC not being scheduled during idle

Project Member Reported by dcheng@chromium.org, May 4 2017

Issue description

Chrome Version: 60.0.3080.5 (Official Build) dev (64-bit) (cohort: Dev)
OS: Win10

What steps will reproduce the problem?
(original test case courtesy of nick@ and ajwong@)
(1) Navigate to https://www.w3.org/2003/08/system-status. Task Manager reports ~15-16MB in use.
(2)  Run the bookmarklet: javascript:(function(){var b=document.body.appendChild(document.createElement('button'));b.onclick=function(){window.open('https://www.w3.org/TR/html5/single-page.html')};b.innerText="Click";})();
(3) Click the button ~5 times and wait for the new tabs to load. Memory usage should peak over 700MB.
(4) Close the new tabs so only the original window is open.
(5) The original tab never drops below ~280MB or so in memory usage, even after several minutes of idle.
(6) Navigating the original tab to about:blank drops some memory but it's at over 200MB still.

Calling window.gc() drops the memory to ~57MB, though it never seems to go much lower after that.

What is the expected result?
Memory usage should drop over time.

What happens instead?
It remains surprisingly high.

Please use labels and text to provide additional information.


For graphics-related bugs, please copy/paste the contents of the about:gpu
page at the end of this report.

 
Cc: hpayer@chromium.org jgruber@chromium.org
 Issue 711934  has been merged into this issue.
Project Member

Comment 2 by bugdroid1@chromium.org, May 5 2017

Status: Fixed (was: Untriaged)
Thanks for the awesome repro case. This should be fixed now.
kGCCallbackFlagCollectAllExternalMemory is actually a pretty big hammer. Scheduling an idle time garbage collection on the blink side is good enough to clean-up garbage later on. Alternatively, we could also schedule a precise GC. haraken, WDYT?
Discussed offline. Hannes' proposal sounds reasonable.

Which is to schedule an idle GC..? Sounds sufficient (modulo issue 704453.)
Project Member

Comment 7 by bugdroid1@chromium.org, May 8 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/448501f6875f8c9c97c69d0cfae50b4b9dd801d1

commit 448501f6875f8c9c97c69d0cfae50b4b9dd801d1
Author: hpayer <hpayer@chromium.org>
Date: Mon May 08 18:09:39 2017

[Api] Add an idle time garbage collection callback flag to GCCallbackFlags.

BUG= chromium:718484 

Review-Url: https://codereview.chromium.org/2867073002
Cr-Commit-Position: refs/heads/master@{#45167}

[modify] https://crrev.com/448501f6875f8c9c97c69d0cfae50b4b9dd801d1/include/v8.h

Project Member

Comment 8 by bugdroid1@chromium.org, May 8 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/448501f6875f8c9c97c69d0cfae50b4b9dd801d1

commit 448501f6875f8c9c97c69d0cfae50b4b9dd801d1
Author: hpayer <hpayer@chromium.org>
Date: Mon May 08 18:09:39 2017

[Api] Add an idle time garbage collection callback flag to GCCallbackFlags.

BUG= chromium:718484 

Review-Url: https://codereview.chromium.org/2867073002
Cr-Commit-Position: refs/heads/master@{#45167}

[modify] https://crrev.com/448501f6875f8c9c97c69d0cfae50b4b9dd801d1/include/v8.h

Project Member

Comment 9 by bugdroid1@chromium.org, May 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9b107d47bd61d2ed77c923ad22dca27b226c9236

commit 9b107d47bd61d2ed77c923ad22dca27b226c9236
Author: hpayer <hpayer@chromium.org>
Date: Thu May 11 07:27:17 2017

Oilpan: Schedule an idle garbage collection after receiving the kGCCallbackScheduleIdleGarbageCollection callback flag.

BUG= chromium:718484 
NOTRY=true

Review-Url: https://codereview.chromium.org/2871743002
Cr-Commit-Position: refs/heads/master@{#470860}

[modify] https://crrev.com/9b107d47bd61d2ed77c923ad22dca27b226c9236/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp

Project Member

Comment 10 by bugdroid1@chromium.org, May 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bcf974f311836b1b26cdc3969e6e9bf3211c0550

commit bcf974f311836b1b26cdc3969e6e9bf3211c0550
Author: tzik <tzik@chromium.org>
Date: Thu May 11 07:52:03 2017

Revert of Oilpan: Schedule an idle garbage collection after receiving the kGCCallbackScheduleIdleGarbageColle… (patchset #2 id:20001 of https://codereview.chromium.org/2871743002/ )

Reason for revert:
This CL causes a compile error on the CI:
https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/39399

The error log was:
[46869/52874] CXX obj/third_party/WebKit/Source/core/core_generated/V8GCController.o
FAILED: obj/third_party/WebKit/Source/core/core_generated/V8GCController.o
(snip)
../../third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp:446:21: error: no member named 'kGCCallbackScheduleIdleGarbageCollection' in namespace 'v8'
    if (flags & v8::kGCCallbackScheduleIdleGarbageCollection) {

Original issue's description:
> Oilpan: Schedule an idle garbage collection after receiving the kGCCallbackScheduleIdleGarbageCollection callback flag.
>
> BUG= chromium:718484 
> NOTRY=true
>
> Review-Url: https://codereview.chromium.org/2871743002
> Cr-Commit-Position: refs/heads/master@{#470860}
> Committed: https://chromium.googlesource.com/chromium/src/+/9b107d47bd61d2ed77c923ad22dca27b226c9236

TBR=haraken@chromium.org,hpayer@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= chromium:718484 

Review-Url: https://codereview.chromium.org/2873873004
Cr-Commit-Position: refs/heads/master@{#470865}

[modify] https://crrev.com/bcf974f311836b1b26cdc3969e6e9bf3211c0550/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp

Project Member

Comment 11 by bugdroid1@chromium.org, May 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2c9367ca48442529ac2669033478eac83b904ca0

commit 2c9367ca48442529ac2669033478eac83b904ca0
Author: hpayer <hpayer@chromium.org>
Date: Mon May 15 14:42:44 2017

Revert "Revert of Oilpan: Schedule an idle garbage collection after receiving the kGCCallbackScheduleIdleGarbageColle… (patchset #2 id:20001 of https://codereview.chromium.org/2871743002/ )"

This reverts commit bcf974f311836b1b26cdc3969e6e9bf3211c0550.

BUG= chromium:719359 , chromium:718484 

Review-Url: https://codereview.chromium.org/2881033002
Cr-Commit-Position: refs/heads/master@{#471756}

[modify] https://crrev.com/2c9367ca48442529ac2669033478eac83b904ca0/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp

Sign in to add a comment