-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: Ulan Degenbaev <ulan@chromium.org> Reviewed-by: Dominik Inführ <dinfuehr@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org> Cr-Commit-Position: refs/heads/master@{#66193} Refs: v8/v8@4b1447e PR-URL: #32885 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
- Loading branch information
1 parent
f98668a
commit 122937f
Showing
7 changed files
with
39 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters