Unverified Commit bafd5444 authored by Anna Henningsen's avatar Anna Henningsen
Browse files

src: do not track BaseObjects via cleanup hooks

Since f59ec2ab, `BaseObject` instances were tracked in heap snapshots
through their associated `CleanupHookCallback`s which were stored on
the `Environment`; however, this is inaccurate, because:

- Edges in heap dumps imply a keeps-alive relationship, but cleanup
  hooks do not keep the `BaseObject`s that they point to alive.
- It loses information about whether `BaseObject` instances are
  GC roots: Even weak `BaseObject`s are now, practically speaking,
  showing up as hanging off a GC root when that isn’t actually the case
  (e.g. in the description of nodejs/node#33468).

Thus, this is a partial revert of f59ec2ab.

Refs: https://github.com/nodejs/node/issues/33468
Refs: https://github.com/nodejs/node/pull/27018

PR-URL: https://github.com/nodejs/node/pull/33809


Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
parent dfdbbd16
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment