$ the-wire · showcase
Node.js adds v8.setHeapProfileNearHeapLimit, fixes environment live lock
By RepoJournal · Filed · About Node.js
Node.js core adds a new API to dump a sampled heap profile near the heap limit and fixes a live lock that could wedge multi-isolate environments.
Node.js adds the `v8.setHeapProfileNearHeapLimit(limit)` API [1], which writes the active sampling heap profile to disk when V8 approaches the heap limit. It complements `v8.setHeapSnapshotNearHeapLimit()` for use cases that need a sampled allocation profile rather than a full heap snapshot. Heap profiling must first be enabled with `v8.startHeapProfile()` or the `--heap-prof` CLI option, and both near-heap-limit APIs can be active on the same isolate. Separately, a fix in `LockManager::ProcessQueue()` [2] resolves a live lock where two environments with blocked requests could wake each other forever; the manager now wakes another environment only when one of its requests can make progress, meaning it is grantable or uses `ifAvailable`. The PR notes it will run the callback with null when the resource is unavailable. Collaborator automation is now documented [3], covering the commit queue, fast-track, stale automation, and saved triage views, and clarifying `needs-ci` semantics and reviewer follow-through. URLPatternInit dictionary conversion now aligns with WHATWG/WebIDL [4], reading members in lexicographical order and using sparse dictionary templates for absent members. This period: 8 commits, 9 PRs across 3 repos, plus two routine CodeQL action bumps in undici [5][6].
Action items
- → Review the v8.setHeapProfileNearHeapLimit API for use with sampled profiling workflows when heap limits are near nodejs/node [plan]
- → Watch for the LockManager live lock fix in upcoming releases if you run concurrent isolates with blocking requests nodejs/node [monitor]
- → Check collaborator docs for automation workflow changes if you are a maintainer nodejs/node [plan]
References
- [1] v8: add setHeapProfileNearHeapLimit ↗ nodejs/node
- [2] src: fix live lock between environments with blocked requests ↗ nodejs/node
- [3] meta: document collaborator automation ↗ nodejs/node
- [4] url: align URLPatternInit dictionary conversion with WebIDL ↗ nodejs/node
- [5] build(deps): bump github/codeql-action/upload-sarif from 4.36.2 to 4.37.9 ↗ nodejs/undici
- [6] build(deps): bump github/codeql-action/analyze from 4.37.3 to 4.37.9 ↗ nodejs/undici