-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src: implement GetDetachedness() in MemoryRetainerNode #44803
Closed
Closed
Conversation
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 allows us to mark weak/detached references in the heap snapshot. Also mark weak/detached BaseObject with Detachedness::kDetached so that the state of the reference can be displayed by frontend consuming the heap snapshot.
nodejs-github-bot
added
c++
Issues and PRs that require attention from people who are familiar with C++.
needs-ci
PRs that need a full CI run.
labels
Sep 27, 2022
16 tasks
legendecas
reviewed
Sep 29, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but linter is complaining.
legendecas
approved these changes
Sep 29, 2022
17 tasks
jasnell
approved these changes
Oct 2, 2022
16 tasks
19 tasks
joyeecheung
added
commit-queue
Add this label to land a pull request using GitHub Actions.
commit-queue-squash
Add this label to instruct the Commit Queue to squash all the PR commits into the first one.
labels
Oct 5, 2022
nodejs-github-bot
removed
the
commit-queue
Add this label to land a pull request using GitHub Actions.
label
Oct 5, 2022
Commit Queue failed- Loading data for nodejs/node/pull/44803 ✔ Done loading data for nodejs/node/pull/44803 ----------------------------------- PR info ------------------------------------ Title src: implement GetDetachedness() in MemoryRetainerNode (#44803) Author Joyee Cheung (@joyeecheung) Branch joyeecheung:detached-retainer -> nodejs:main Labels c++, needs-ci, commit-queue-squash Commits 2 - src: implement GetDetachedness() in MemoryRetainerNode - fixup! src: implement GetDetachedness() in MemoryRetainerNode Committers 1 - Joyee Cheung PR-URL: https://github.com/nodejs/node/pull/44803 Reviewed-By: Chengzhong Wu Reviewed-By: James M Snell ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/44803 Reviewed-By: Chengzhong Wu Reviewed-By: James M Snell -------------------------------------------------------------------------------- ℹ This PR was created on Tue, 27 Sep 2022 07:24:01 GMT ✔ Approvals: 2 ✔ - Chengzhong Wu (@legendecas) (TSC): https://github.com/nodejs/node/pull/44803#pullrequestreview-1124920321 ✔ - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/44803#pullrequestreview-1127622249 ✖ Last GitHub CI failed ℹ Last Full PR CI on 2022-10-04T17:02:48Z: https://ci.nodejs.org/job/node-test-pull-request/47071/ - Querying data for job/node-test-pull-request/47071/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/3189452691 |
nodejs-github-bot
added
the
commit-queue-failed
An error occurred while landing this pull request using GitHub Actions.
label
Oct 5, 2022
joyeecheung
added a commit
that referenced
this pull request
Oct 5, 2022
This allows us to mark weak/detached references in the heap snapshot. Also mark weak/detached BaseObject with Detachedness::kDetached so that the state of the reference can be displayed by frontend consuming the heap snapshot. PR-URL: #44803 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: James M Snell <[email protected]>
This was referenced Oct 6, 2022
This was referenced Oct 9, 2022
danielleadams
pushed a commit
that referenced
this pull request
Oct 11, 2022
This allows us to mark weak/detached references in the heap snapshot. Also mark weak/detached BaseObject with Detachedness::kDetached so that the state of the reference can be displayed by frontend consuming the heap snapshot. PR-URL: #44803 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: James M Snell <[email protected]>
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
c++
Issues and PRs that require attention from people who are familiar with C++.
commit-queue-failed
An error occurred while landing this pull request using GitHub Actions.
commit-queue-squash
Add this label to instruct the Commit Queue to squash all the PR commits into the first one.
needs-ci
PRs that need a full CI run.
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.
This allows us to mark weak/detached references in the heap snapshot. Also mark weak/detached BaseObject with Detachedness::kDetached so that the state of the reference can be displayed by frontend consuming the heap snapshot.
With the following snippet:
The cleanup queue in the generated heap snapshot previously looked like this in the DevTools - nodes that will be GC'ed once they are no longer referenced from JS land are not distinguished from nodes that are kept alive from the C++ land.
Now it looks like this - nodes that will be GC'ed once they are no longer referenced from JS have the
Detached
label (note that in the case of ChannelWrap, if we take the snapshot before the query completes, the ChannelWrap won't be marked asDetached
, because it would still be reachable from the QueryWrap which is kept alive by C++ i.e. being attached - objects reachable from attached objects are also considered attached by DevTools):