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

Issue 1038653003: Change halfway-to-the-max GC trigger to measure committed pages, not allocated objects

Created:
5 years, 9 months ago by Erik Corry Chromium.org
Modified:
5 years, 8 months ago
CC:
v8-dev
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Change halfway-to-the-max GC trigger to measure committed pages, not allocated objects This also adds a little more logging around how we decide to trigger GCs, and it renames a predicate function that looked like a command. This will trigger more GCs when we are close to the limit, but if the incremental GCs are not compacting then that may not help much. However, that's a change that's being dealt with in a different CL R=hpayer@chromium.org,ulan@chromium.org BUG=

Patch Set 1 #

Total comments: 10

Patch Set 2 : Responses to feedback #

Patch Set 3 : Lower commit limit in the presence of fragmentatuion #

Patch Set 4 : Don't provoke GC unless it will help #

Total comments: 1

Patch Set 5 : Check committed memory limit, and add test #

Patch Set 6 : Speed up tests, skip on slow platforms #

Patch Set 7 : Fix compile error #

Total comments: 4

Patch Set 8 : A little less agressive #

Patch Set 9 : Fix thinko #

Unified diffs Side-by-side diffs Delta from patch set Stats (+102 lines, -90 lines) Patch
M src/heap/heap.h View 1 2 3 4 6 chunks +33 lines, -11 lines 0 comments Download
M src/heap/heap.cc View 1 2 3 4 5 6 7 8 9 chunks +26 lines, -19 lines 0 comments Download
M src/heap/heap-inl.h View 1 2 3 4 5 6 7 1 chunk +3 lines, -1 line 0 comments Download
M src/heap/mark-compact.h View 1 2 3 4 2 chunks +4 lines, -2 lines 0 comments Download
M src/heap/mark-compact.cc View 1 2 3 4 5 6 7 3 chunks +5 lines, -4 lines 0 comments Download
M src/heap/mark-compact-inl.h View 1 chunk +1 line, -1 line 0 comments Download
A + test/mjsunit/gc-early-with-fragmentation.js View 1 2 3 4 5 1 chunk +21 lines, -52 lines 0 comments Download
M test/mjsunit/mjsunit.status View 1 2 3 4 5 3 chunks +9 lines, -0 lines 0 comments Download

Messages

Total messages: 34 (10 generated)
Erik Corry Chromium.org
5 years, 9 months ago (2015-03-25 14:02:54 UTC) #1
Hannes Payer (out of office)
a few nits https://codereview.chromium.org/1038653003/diff/1/src/heap/heap.cc File src/heap/heap.cc (right): https://codereview.chromium.org/1038653003/diff/1/src/heap/heap.cc#newcode57 src/heap/heap.cc:57: static const intptr_t kDefaultMaxOldGenSize = 700ul ...
5 years, 9 months ago (2015-03-25 14:30:06 UTC) #2
Erik Corry Chromium.org
https://codereview.chromium.org/1038653003/diff/1/src/heap/heap.cc File src/heap/heap.cc (right): https://codereview.chromium.org/1038653003/diff/1/src/heap/heap.cc#newcode57 src/heap/heap.cc:57: static const intptr_t kDefaultMaxOldGenSize = 700ul * (kPointerSize / ...
5 years, 9 months ago (2015-03-25 15:16:07 UTC) #3
ulan
https://codereview.chromium.org/1038653003/diff/60001/src/heap/heap.h File src/heap/heap.h (right): https://codereview.chromium.org/1038653003/diff/60001/src/heap/heap.h#newcode1348 src/heap/heap.h:1348: inline bool OldGenerationAllocationLimitReached(); To be consistent, we need similar ...
5 years, 9 months ago (2015-03-26 08:28:55 UTC) #4
Erik Corry Chromium.org
I added checks for committed-memory-limit in OldGenerationAllocationLimitReached. This is called to decide between old and ...
5 years, 8 months ago (2015-04-06 14:00:53 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1038653003/100001
5 years, 8 months ago (2015-04-06 14:20:51 UTC) #7
commit-bot: I haz the power
Try jobs failed on following builders: v8_presubmit on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/1728)
5 years, 8 months ago (2015-04-06 14:24:43 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1038653003/120001
5 years, 8 months ago (2015-04-06 15:07:13 UTC) #11
commit-bot: I haz the power
Try jobs failed on following builders: v8_presubmit on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/1732)
5 years, 8 months ago (2015-04-06 15:10:45 UTC) #13
ulan
https://codereview.chromium.org/1038653003/diff/120001/src/heap/heap.cc File src/heap/heap.cc (right): https://codereview.chromium.org/1038653003/diff/120001/src/heap/heap.cc#newcode5274 src/heap/heap.cc:5274: old_generation_allocation_limit_ = limit + new_space_.Capacity(); Should we enforce that ...
5 years, 8 months ago (2015-04-07 13:27:19 UTC) #14
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1038653003/140001
5 years, 8 months ago (2015-04-08 11:57:46 UTC) #16
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1038653003/160001
5 years, 8 months ago (2015-04-08 12:08:03 UTC) #18
commit-bot: I haz the power
Try jobs failed on following builders: v8_presubmit on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/1788)
5 years, 8 months ago (2015-04-08 12:17:06 UTC) #20
Erik Corry Chromium.org
The try job failed because of the issue fixed in https://codereview.chromium.org/1078533003/ PTAL https://codereview.chromium.org/1038653003/diff/120001/src/heap/heap.cc File src/heap/heap.cc ...
5 years, 8 months ago (2015-04-09 12:26:16 UTC) #21
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1038653003/160001
5 years, 8 months ago (2015-04-09 13:15:25 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: v8_presubmit on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/1842)
5 years, 8 months ago (2015-04-09 13:33:24 UTC) #25
Erik Corry Chromium.org
Ping!
5 years, 8 months ago (2015-04-13 13:12:56 UTC) #26
ulan
Sorry for the delay. I've been thinking if we can get rid of the "halfway-to-the-max" ...
5 years, 8 months ago (2015-04-13 13:58:04 UTC) #27
Erik Corry Chromium.org
I think we need both limits. It's really hard to know how well allocation is ...
5 years, 8 months ago (2015-04-13 15:12:16 UTC) #28
ulan
There are two different questions to discuss: 1. Do we need two limits? 2. Do ...
5 years, 8 months ago (2015-04-14 08:54:57 UTC) #29
Hannes Payer (out of office)
The live counter correctly tells us how much memory is live, but decrementing does not ...
5 years, 8 months ago (2015-04-14 09:29:27 UTC) #30
Erik Corry Chromium.org
The C+2Y is another way of saying "halfway to the max" for committed memory, but ...
5 years, 8 months ago (2015-04-14 09:33:07 UTC) #31
ulan
> A concrete example: If we have X=200, C=500, limit = 700, then in your ...
5 years, 8 months ago (2015-04-15 09:55:01 UTC) #32
Erik Corry Chromium.org
5 years, 8 months ago (2015-04-15 14:46:47 UTC) #33
After some offline discussion here's how I understand the new plan:

* This trigger will be for starting incremental GC only, not for stop-the-world.
* We try to mark at the same speed as new-space allocation, which (rule of
thumb) is about a third the speed of old-space allocation.
* We estimate the amount of memory that needs marking to be the live objects
from the last GC plus any objects allocated after that.
* Therefore we aim to start incremental marking when the allocated objects are
3x as big as the remaining distance to the allocation limit.
* We will also start incremental marking when the allocated objects are 3x as
big as the difference between the max heap size and the committed memory.
* These two rules together mean we expect to finish incremental marking before
we hit either the allocated object limit or the committed memory limit.

A consequence of this is that sometimes we will start incremental marking
immediately after a GC. For example if we have X=450 C=550 then we aim to mark
450Mbytes while we allocate 150Mbytes (one third), so we will start immediately,
since we are only 150M from the 700M and we want to finish before C hits that
limit.

All this only makes sense if an incremental GC actually compacts at the end. 
But I think this is the case now, even if we the incremental GC ends during an
idle notification?

Powered by Google App Engine
This is Rietveld 408576698