[heap] Add sqrt heap limit flag. [v8/v8 : main]

0 views
Skip to first unread message

Etienne Pierre-Doray (Gerrit)

unread,
May 11, 2026, 11:29:24 AM (8 days ago) May 11
to Dominik Inführ, android-bu...@system.gserviceaccount.com, chrom...@appspot.gserviceaccount.com, v8-s...@luci-project-accounts.iam.gserviceaccount.com, Hannes Payer, jgrube...@chromium.org, dmercadi...@chromium.org, mlippau...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com
Attention needed from Dominik Inführ

Etienne Pierre-Doray voted and added 1 comment

Votes added by Etienne Pierre-Doray

Commit-Queue+1

1 comment

File src/flags/flag-definitions.h
Line 2699, Patchset 18: sqrt_allocation_limits, true,
Etienne Pierre-Doray . unresolved

TODO: disable

Open in Gerrit

Related details

Attention is currently required from:
  • Dominik Inführ
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I52297256f62e30abda6d80e36b165684cf0f74e6
Gerrit-Change-Number: 7575773
Gerrit-PatchSet: 24
Gerrit-Owner: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-Reviewer: Dominik Inführ <dinf...@chromium.org>
Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-Attention: Dominik Inführ <dinf...@chromium.org>
Gerrit-Comment-Date: Mon, 11 May 2026 15:29:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
unsatisfied_requirement
open
diffy

Dominik Inführ (Gerrit)

unread,
May 13, 2026, 7:04:20 AM (7 days ago) May 13
to Etienne Pierre-Doray, android-bu...@system.gserviceaccount.com, chrom...@appspot.gserviceaccount.com, v8-s...@luci-project-accounts.iam.gserviceaccount.com, Hannes Payer, jgrube...@chromium.org, dmercadi...@chromium.org, mlippau...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com
Attention needed from Etienne Pierre-Doray

Dominik Inführ added 1 comment

File src/heap/heap-controller.cc
Line 265, Patchset 25 (Latest): computed_old_generation_allocation_limit = std::min<uint64_t>(
Dominik Inführ . unresolved

Can we have a SqrtLimit method here that we then reuse for old gen+global limit?

Open in Gerrit

Related details

Attention is currently required from:
  • Etienne Pierre-Doray
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I52297256f62e30abda6d80e36b165684cf0f74e6
Gerrit-Change-Number: 7575773
Gerrit-PatchSet: 25
Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-Comment-Date: Wed, 13 May 2026 11:04:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Dominik Inführ (Gerrit)

unread,
May 13, 2026, 8:46:57 AM (7 days ago) May 13
to Etienne Pierre-Doray, android-bu...@system.gserviceaccount.com, chrom...@appspot.gserviceaccount.com, v8-s...@luci-project-accounts.iam.gserviceaccount.com, Hannes Payer, jgrube...@chromium.org, dmercadi...@chromium.org, mlippau...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com
Attention needed from Etienne Pierre-Doray

Dominik Inführ added 1 comment

File src/heap/heap-controller.cc
Line 263, Patchset 25 (Latest): // `total_size_excluding_external_at_last_gc_`, which includes young
Dominik Inführ . unresolved

Does `total_size_excluding_external_at_last_gc_` really need to be a field? I suppose we could also just compute `heap_->SizeOfObjects() + heap_->EmbedderSizeOfObjects()` here directly?

Gerrit-Comment-Date: Wed, 13 May 2026 12:46:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Etienne Pierre-Doray (Gerrit)

unread,
May 13, 2026, 1:15:01 PM (6 days ago) May 13
to Dominik Inführ, android-bu...@system.gserviceaccount.com, chrom...@appspot.gserviceaccount.com, v8-s...@luci-project-accounts.iam.gserviceaccount.com, Hannes Payer, jgrube...@chromium.org, dmercadi...@chromium.org, mlippau...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com
Attention needed from Dominik Inführ

Etienne Pierre-Doray added 3 comments

Patchset-level comments
File-level comment, Patchset 26 (Latest):
Etienne Pierre-Doray . resolved

PTAnL?

File src/heap/heap-controller.cc
Line 263, Patchset 25: // `total_size_excluding_external_at_last_gc_`, which includes young
Dominik Inführ . unresolved

Does `total_size_excluding_external_at_last_gc_` really need to be a field? I suppose we could also just compute `heap_->SizeOfObjects() + heap_->EmbedderSizeOfObjects()` here directly?

Etienne Pierre-Doray

`heap_->SizeOfObjects() + heap_->EmbedderSizeOfObjects()` is different because it doesn't take a snapshot right after a GC, and since we can call UpdateAllocationLimits() in a few situations that's not right after a GC, this would give a different limit.

Line 265, Patchset 25: computed_old_generation_allocation_limit = std::min<uint64_t>(
Dominik Inführ . resolved

Can we have a SqrtLimit method here that we then reuse for old gen+global limit?

Etienne Pierre-Doray

Good idea, done!
I added a method to MemoryController, to reflect GrowingFactor.

Open in Gerrit

Related details

Attention is currently required from:
  • Dominik Inführ
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I52297256f62e30abda6d80e36b165684cf0f74e6
Gerrit-Change-Number: 7575773
Gerrit-PatchSet: 26
Gerrit-Attention: Dominik Inführ <dinf...@chromium.org>
Gerrit-Comment-Date: Wed, 13 May 2026 17:14:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Dominik Inführ <dinf...@chromium.org>
unsatisfied_requirement
open
diffy

Dominik Inführ (Gerrit)

unread,
May 18, 2026, 10:02:58 AM (yesterday) May 18
to Etienne Pierre-Doray, android-bu...@system.gserviceaccount.com, chrom...@appspot.gserviceaccount.com, v8-s...@luci-project-accounts.iam.gserviceaccount.com, Hannes Payer, jgrube...@chromium.org, dmercadi...@chromium.org, mlippau...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com
Attention needed from Etienne Pierre-Doray

Dominik Inführ voted and added 2 comments

Votes added by Dominik Inführ

Code-Review+1

2 comments

Patchset-level comments
Dominik Inführ . resolved

Thanks, LGTM

File src/heap/heap-controller.cc
Line 263, Patchset 25: // `total_size_excluding_external_at_last_gc_`, which includes young
Dominik Inführ . resolved

Does `total_size_excluding_external_at_last_gc_` really need to be a field? I suppose we could also just compute `heap_->SizeOfObjects() + heap_->EmbedderSizeOfObjects()` here directly?

Etienne Pierre-Doray

`heap_->SizeOfObjects() + heap_->EmbedderSizeOfObjects()` is different because it doesn't take a snapshot right after a GC, and since we can call UpdateAllocationLimits() in a few situations that's not right after a GC, this would give a different limit.

Dominik Inführ

Acknowledged

Open in Gerrit

Related details

Attention is currently required from:
  • Etienne Pierre-Doray
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I52297256f62e30abda6d80e36b165684cf0f74e6
Gerrit-Change-Number: 7575773
Gerrit-PatchSet: 26
Gerrit-Owner: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-Reviewer: Dominik Inführ <dinf...@chromium.org>
Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-Comment-Date: Mon, 18 May 2026 14:02:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Etienne Pierre-Doray <etie...@chromium.org>
Comment-In-Reply-To: Dominik Inführ <dinf...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Etienne Pierre-Doray (Gerrit)

unread,
9:44 AM (12 hours ago) 9:44 AM
to Dominik Inführ, android-bu...@system.gserviceaccount.com, chrom...@appspot.gserviceaccount.com, v8-s...@luci-project-accounts.iam.gserviceaccount.com, Hannes Payer, jgrube...@chromium.org, dmercadi...@chromium.org, mlippau...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com

Etienne Pierre-Doray added 2 comments

Patchset-level comments
File-level comment, Patchset 27 (Latest):
Etienne Pierre-Doray . resolved

Thanks!

File src/flags/flag-definitions.h
Line 2699, Patchset 18: sqrt_allocation_limits, true,
Etienne Pierre-Doray . resolved

TODO: disable

Etienne Pierre-Doray

Done

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: I52297256f62e30abda6d80e36b165684cf0f74e6
    Gerrit-Change-Number: 7575773
    Gerrit-PatchSet: 27
    Gerrit-Comment-Date: Tue, 19 May 2026 13:44:17 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Etienne Pierre-Doray <etie...@chromium.org>
    satisfied_requirement
    open
    diffy

    Etienne Pierre-Doray (Gerrit)

    unread,
    9:44 AM (12 hours ago) 9:44 AM
    to Dominik Inführ, android-bu...@system.gserviceaccount.com, chrom...@appspot.gserviceaccount.com, v8-s...@luci-project-accounts.iam.gserviceaccount.com, Hannes Payer, jgrube...@chromium.org, dmercadi...@chromium.org, mlippau...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com

    Etienne Pierre-Doray voted Commit-Queue+2

    Commit-Queue+2
    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: I52297256f62e30abda6d80e36b165684cf0f74e6
    Gerrit-Change-Number: 7575773
    Gerrit-PatchSet: 27
    Gerrit-Owner: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Dominik Inführ <dinf...@chromium.org>
    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-CC: Hannes Payer <hpa...@chromium.org>
    Gerrit-Comment-Date: Tue, 19 May 2026 13:44:22 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    v8-scoped@luci-project-accounts.iam.gserviceaccount.com (Gerrit)

    unread,
    10:31 AM (11 hours ago) 10:31 AM
    to Etienne Pierre-Doray, Dominik Inführ, android-bu...@system.gserviceaccount.com, chrom...@appspot.gserviceaccount.com, Hannes Payer, jgrube...@chromium.org, dmercadi...@chromium.org, mlippau...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com

    v8-s...@luci-project-accounts.iam.gserviceaccount.com submitted the change with unreviewed changes

    Unreviewed changes

    26 is the latest approved patch-set.
    The change was submitted with unreviewed changes in the following files:

    ```
    The name of the file: src/flags/flag-definitions.h
    Insertions: 1, Deletions: 1.

    @@ -2699,7 +2699,7 @@
    "Max external memory value (in GB) checked for a reasonable size, 0 "
    "to disable the check.")
    DEFINE_BOOL(
    - sqrt_allocation_limits, true,
    + sqrt_allocation_limits, false,
    "Old generation and global heap limit growth scale based on the sqrt of "
    "estimated GC cost.")
    DEFINE_INT(
    ```

    Change information

    Commit message:
    [heap] Add sqrt heap limit flag.

    This is a simple Sqrt heap limit implementation inspired from
    https://arxiv.org/abs/2204.10455.
    This is implemented behind sqrt_allocation_limits flag,
    with a configurable growing factor limit.
    Bug: 477484620
    Change-Id: I52297256f62e30abda6d80e36b165684cf0f74e6
    Commit-Queue: Etienne Pierre-Doray <etie...@chromium.org>
    Reviewed-by: Dominik Inführ <dinf...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#107427}
    Files:
    • M src/flags/flag-definitions.h
    • M src/heap/heap-controller.cc
    • M src/heap/heap-controller.h
    Change size: M
    Delta: 3 files changed, 85 insertions(+), 17 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Dominik Inführ
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: I52297256f62e30abda6d80e36b165684cf0f74e6
    Gerrit-Change-Number: 7575773
    Gerrit-PatchSet: 28
    Gerrit-Owner: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Dominik Inführ <dinf...@chromium.org>
    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages