src: do not track weak BaseObjects as childrens of Realms#63842
Open
addaleax wants to merge 4 commits into
Open
src: do not track weak BaseObjects as childrens of Realms#63842addaleax wants to merge 4 commits into
BaseObjects as childrens of Realms#63842addaleax wants to merge 4 commits into
Conversation
Allowing the addition of child nodes without an explicit edge between them enables expressing a relationship of the "node A keeps track of node B and no other node does, but node A does not keep node B alive" kind, which is the relationship between `Realm`s and weak `BaseObject` instances. This is a prerequisite for the following commit. Signed-off-by: Anna Henningsen <anna@addaleax.net>
Heap dumps are used for analyzing the relationship between objects that keep each other alive, so that retainers of memory can be detected and memory leaks fixed. 6e60ab7 broke this for a wide range of `BaseObject` instances. Marking all `BaseObject`s, including weak ones, as children of `Realm` and `Environment` instances gives the incorrect impression that they are held alive by those objects, effectively hiding the "real" set of strong roots that keep other objects alive through GC. While I still disagree with the decision in 6e60ab7 not to mark strong `BaseObject`s as proper roots in the object graph, this commit keeps that decision intact, and only removes edges to weak `BaseObject` instances. Refs: nodejs#57417 Signed-off-by: Anna Henningsen <anna@addaleax.net>
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.
src: allow tracking children in
MemoryTrackerwithout edgesAllowing the addition of child nodes without an explicit edge
between them enables expressing a relationship of the
"node A keeps track of node B and no other node does,
but node A does not keep node B alive" kind, which is
the relationship between
Realms and weakBaseObjectinstances.This is a prerequisite for the following commit.
src: do not track weak
BaseObjects as childrens ofRealmsHeap dumps are used for analyzing the relationship between
objects that keep each other alive, so that retainers of
memory can be detected and memory leaks fixed.
6e60ab7 broke this for a wide range of
BaseObjectinstances. Marking all
BaseObjects, including weak ones,as children of
RealmandEnvironmentinstances givesthe incorrect impression that they are held alive by those
objects, effectively hiding the "real" set of strong roots
that keep other objects alive through GC.
While I still disagree with the decision in 6e60ab7
not to mark strong
BaseObjects as proper roots in theobject graph, this commit keeps that decision intact, and only
removes edges to weak
BaseObjectinstances.Refs: #57417