fix(ext/node): add v8.queryObjects() and util.queryObjects()#34159
Merged
Conversation
Implements the leak-detection helper exposed by Node's `node:v8` and
`node:util` modules. The count form is what the upstream leak tests
(`parallel/test-diagnostics-channel-memory-leak.js`,
`es-module/test-vm-source-text-module-leak.js`) rely on; without it the
test runner throws `TypeError: queryObjects is not a function`.
V8's `HeapProfiler::QueryObjects` isn't bound in rusty_v8, so the count
is computed by walking the JSON heap snapshot and matching nodes by
constructor name. Taking the snapshot forces a full GC, which is exactly
what the leak tests need. The default ("array") form would require live
object handles and returns an empty array; `{ format: 'summary' }`
returns a one-line summary built from the count.
Co-Authored-By: Divy Srivastava <[email protected]>
Contributor
|
|
littledivy
reviewed
May 17, 2026
Comment on lines
+175
to
+176
| // would require V8's `HeapProfiler::QueryObjects`, which isn't exposed in the | ||
| // rusty_v8 bindings; the count form is what Node's leak tests rely on. |
Member
There was a problem hiding this comment.
@divybot Open an orchid issue about this rusty_v8 API
littledivy
approved these changes
May 17, 2026
littledivy
added a commit
to crowlKats/deno
that referenced
this pull request
Jun 10, 2026
…d#34159) Closes denoland/orchid#122 Co-authored-by: divybot <[email protected]> Co-authored-by: Divy Srivastava <[email protected]>
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.
Closes denoland/orchid#122