Repository navigation
src: be less conservative in NearHeapLimitCallback - #50718
Closed
joyeecheung wants to merge 1 commit into
Closed
joyeecheung wants to merge 1 commit into
joyeecheung wants to merge 1 commit into
Conversation
joyeecheung
commented
Nov 13, 2023
Member
Author
There was a problem hiding this comment.
Not sure about this formula - maybe we should use inital_heap_limit here as the base instead of avoid unbound growth of the new limit
joyeecheung
marked this pull request as draft
November 13, 2023 22:53
Previously the callback only considered potential overhead coming from promotion. As it turns out the cache for calculated line ends could also increase heap memory usage during heap snapshot generation. This patch makes the raised limit less conservative using a formula of (young_gen_size + old_gen_size / 2) for the extra leeway given to the heap limit. Drive-by: use uv_get_available_memory() to calculate the memory available to the process directly and print the memory in MB in the debugging logs.
joyeecheung
force-pushed
the
near-heap-limit-limit
branch
from
November 14, 2023 00:47
e9e6170 to
a6616b1
Compare
Member
Author
|
I believe this is no longer necessary after the changes in v8 https://issues.chromium.org/issues/42204564 that ensures the heap snapshot generation/serialization only use off-heap memory for the heap snapshot itself (need to wait until v8 12.5 update to roll it in though). |
Member
Author
|
Actually on macOS, #50711 is still skipped, because of libuv/libuv#3897 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously the callback only considered potential overhead coming from promotion. As it turns out the cache for calculated line ends could also increase heap memory usage during heap snapshot generation. This patch makes the raised limit less conservative using a formula of (young_gen_size + old_gen_size / 2) for the extra leeway given to the heap limit.
Drive-by: use uv_get_available_memory() to calculate the memory available to the process directly and print the memory in MB in the debugging logs.
Refs: #50711