[wasm] Fix GC memory leak in Wasm interpreter [v8/v8 : main]

0 views
Skip to first unread message

Emmanuel Romero Ruiz (Gerrit)

unread,
Jan 8, 2026, 2:00:15 PM (4 days ago) Jan 8
to Paolo Severini, V8 LUCI CQ, Daniel Lehmann, v8-flag...@chromium.org, v8-re...@googlegroups.com, was...@google.com
Attention needed from Daniel Lehmann and Paolo Severini

Emmanuel Romero Ruiz added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Emmanuel Romero Ruiz . resolved

This CL looks good to me.

Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Lehmann
  • Paolo Severini
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • 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: I0618785916bac78a75692afdda7262ebf50f8d8c
Gerrit-Change-Number: 7416210
Gerrit-PatchSet: 1
Gerrit-Owner: Paolo Severini <paol...@microsoft.com>
Gerrit-Reviewer: Daniel Lehmann <dleh...@chromium.org>
Gerrit-Reviewer: Emmanuel Romero Ruiz <emro...@microsoft.com>
Gerrit-Reviewer: Paolo Severini <paol...@microsoft.com>
Gerrit-Attention: Daniel Lehmann <dleh...@chromium.org>
Gerrit-Attention: Paolo Severini <paol...@microsoft.com>
Gerrit-Comment-Date: Thu, 08 Jan 2026 19:00:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Daniel Lehmann (Gerrit)

unread,
8:47 AM (13 hours ago) 8:47 AM
to Paolo Severini, Michael Lippautz, V8 LUCI CQ, Emmanuel Romero Ruiz, v8-flag...@chromium.org, v8-re...@googlegroups.com, was...@google.com
Attention needed from Paolo Severini

Daniel Lehmann voted and added 1 comment

Votes added by Daniel Lehmann

Code-Review+1

1 comment

Patchset-level comments
Daniel Lehmann . resolved

Rubber stamping this Drumbrake-only change as usual. But since I'm not a GC expert, I think it would be beneficial to discuss this (or at least CC) the GC team, hence adding Michael Lippauz.

Also more generally / background info: How was this discovered? Would Edge using DrumBrake reliably OOM, e.g., on WasmGC-heavy Dart or Kotlin applications? (say https://chromium-workloads.web.app/jetstream/main/?test=Dart-flute-todomvc-wasm in the upcoming JetStream 3 benchmark)?

Open in Gerrit

Related details

Attention is currently required from:
  • Paolo Severini
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • 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: I0618785916bac78a75692afdda7262ebf50f8d8c
Gerrit-Change-Number: 7416210
Gerrit-PatchSet: 1
Gerrit-Owner: Paolo Severini <paol...@microsoft.com>
Gerrit-Reviewer: Daniel Lehmann <dleh...@chromium.org>
Gerrit-Reviewer: Emmanuel Romero Ruiz <emro...@microsoft.com>
Gerrit-Reviewer: Paolo Severini <paol...@microsoft.com>
Gerrit-CC: Michael Lippautz <mlip...@chromium.org>
Gerrit-Attention: Paolo Severini <paol...@microsoft.com>
Gerrit-Comment-Date: Mon, 12 Jan 2026 13:47:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Michael Lippautz (Gerrit)

unread,
8:50 AM (13 hours ago) 8:50 AM
to Paolo Severini, Daniel Lehmann, V8 LUCI CQ, Emmanuel Romero Ruiz, v8-flag...@chromium.org, v8-re...@googlegroups.com, was...@google.com
Attention needed from Paolo Severini

Michael Lippautz added 1 comment

Commit Message
Line 21, Patchset 1 (Latest):- V8 inflates the old space allocation limit (observed: 16MB → 1389MB)
Michael Lippautz . unresolved

This seems wrong. The maximum growing factor is 4x give or take. With 16M live size this should be ~64M for the next GC.

Can you provide a log with `--trace-gc,--trace-gc-verbose` ?

Open in Gerrit

Related details

Attention is currently required from:
  • Paolo Severini
Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement 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: I0618785916bac78a75692afdda7262ebf50f8d8c
    Gerrit-Change-Number: 7416210
    Gerrit-PatchSet: 1
    Gerrit-Owner: Paolo Severini <paol...@microsoft.com>
    Gerrit-Reviewer: Daniel Lehmann <dleh...@chromium.org>
    Gerrit-Reviewer: Emmanuel Romero Ruiz <emro...@microsoft.com>
    Gerrit-Reviewer: Paolo Severini <paol...@microsoft.com>
    Gerrit-CC: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Attention: Paolo Severini <paol...@microsoft.com>
    Gerrit-Comment-Date: Mon, 12 Jan 2026 13:50:14 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Paolo Severini (Gerrit)

    unread,
    9:55 AM (12 hours ago) 9:55 AM
    to Daniel Lehmann, Michael Lippautz, V8 LUCI CQ, Emmanuel Romero Ruiz, v8-flag...@chromium.org, v8-re...@googlegroups.com, was...@google.com
    Attention needed from Michael Lippautz

    Paolo Severini added 2 comments

    Patchset-level comments
    Daniel Lehmann . resolved

    Rubber stamping this Drumbrake-only change as usual. But since I'm not a GC expert, I think it would be beneficial to discuss this (or at least CC) the GC team, hence adding Michael Lippauz.

    Also more generally / background info: How was this discovered? Would Edge using DrumBrake reliably OOM, e.g., on WasmGC-heavy Dart or Kotlin applications? (say https://chromium-workloads.web.app/jetstream/main/?test=Dart-flute-todomvc-wasm in the upcoming JetStream 3 benchmark)?

    Paolo Severini

    This issue was raised by the Google Sheets team, which noticed an increase of OOM crashes only on Edge, which we our telemetry mapped to the use of the Wasm interpreter.
    I could easily reproduce the issue running Google Sheets Edge with the interpreter enabled (with the V8 heap usage increasing ~20MB/sec).

    Initially I thought that the problem could be related to the way ref objects are managed and that the leak might be caused by handles accumulating in the HandleScope for some long-running function. But even after a very long refactoring, the problem was still there, and I realized that the issue disappeared if the interpreter periodically triggered GCs during stack checks. This made me think that the problem could be related to some GC heuristics that does not work well with wasmgc code that runs relatively slowly and allocates a lot of objects.

    Commit Message
    Line 21, Patchset 1 (Latest):- V8 inflates the old space allocation limit (observed: 16MB → 1389MB)
    Michael Lippautz . unresolved

    This seems wrong. The maximum growing factor is 4x give or take. With 16M live size this should be ~64M for the next GC.

    Can you provide a log with `--trace-gc,--trace-gc-verbose` ?

    Paolo Severini

    The comment maybe is imprecise, the allocation limit does not grow immediately from 16MB to 1.4GB, it happens through time.
    I will try to generate a log with `--trace-gc,--trace-gc-verbose`. Google Sheets is a very large application; I will also try with the Dart JetStream 3 workload, which should be more manageable.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Michael Lippautz
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement 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: I0618785916bac78a75692afdda7262ebf50f8d8c
    Gerrit-Change-Number: 7416210
    Gerrit-PatchSet: 1
    Gerrit-Owner: Paolo Severini <paol...@microsoft.com>
    Gerrit-Reviewer: Daniel Lehmann <dleh...@chromium.org>
    Gerrit-Reviewer: Emmanuel Romero Ruiz <emro...@microsoft.com>
    Gerrit-Reviewer: Paolo Severini <paol...@microsoft.com>
    Gerrit-CC: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Comment-Date: Mon, 12 Jan 2026 14:55:40 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Michael Lippautz <mlip...@chromium.org>
    Comment-In-Reply-To: Daniel Lehmann <dleh...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages