Unverified Commit 122937fc authored by Anna Henningsen's avatar Anna Henningsen Committed by Beth Griggs
Browse files

deps: V8: cherry-pick 4b1447e4bb0e

Original commit message:

    Improve V8 GC logic for external memory

    The logic for V8 GC normally only takes the external memory growth
    since last mark-compact into account. Unfortunately, the amount of
    external memory recorded at the end of MC is often too high. The
    reason is that it might take a while for the external memory
    associated with the GCed objects to be released (e.g. V8 itself post a
    task to release external memory for ArrayBuffer backing stores). In a
    worst case scenario GC is driven only by external memory and none of
    the external memory is released by the end of the MC. Then each MC
    will record the external memory at its highest point and the GC logic
    will allow the external memory to grow a bit higher each time which
    can lead to excessive memory use.

    This patch improves the situation a bit by calculating the growth from
    the lowest external memory seen since the last MC. That way the growth
    calculation will be offset from a level presumably closer to the
    intended one (to what it would have been if the external memory
    associated with the GCed objects was released during the MC). Now,
    this fix is not perfect because it can be thrown off by external
    memory growth occurring before the lingering memory is
    released. However, it seems to work rather well in practice (e.g. when
    playing MSE video on YT).

    Bug: v8:10185
    Change-Id: Ifcdd87eb45f3ae4a99d2aeec667c3ae4ca9a52b6
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2042711


Reviewed-by: default avatarUlan Degenbaev <ulan@chromium.org>
Reviewed-by: default avatarDominik Inführ <dinfuehr@chromium.org>
Reviewed-by: default avatarJakob Gruber <jgruber@chromium.org>
    Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#66193}

Refs: https://github.com/v8/v8/commit/4b1447e4bb0e306c40214026342858664a13b551

PR-URL: https://github.com/nodejs/node/pull/32885


Reviewed-By: default avatarMichaël Zasso <targos@protonmail.com>
Reviewed-By: default avatarUjjwal Sharma <ryzokuken@disroot.org>
Reviewed-By: default avatarGerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: default avatarBeth Griggs <Bethany.Griggs@uk.ibm.com>
parent f98668ad
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment