Skip to content

[pull] main from nodejs:main#1115

Merged
pull[bot] merged 2 commits into
adamlaska:mainfrom
nodejs:main
Jul 9, 2026
Merged

[pull] main from nodejs:main#1115
pull[bot] merged 2 commits into
adamlaska:mainfrom
nodejs:main

Conversation

@pull

@pull pull Bot commented Jul 9, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

semimikoh and others added 2 commits July 9, 2026 06:31
Blob.prototype.stream() registered a wakeup callback on the
underlying source's start() and never released it. The strong
Reader::wakeup_ handle kept the reader -- and through it the
blob's DataQueue and backing store -- reachable as a GC root, so
the source buffer leaked on every stream() call. On Node 26+,
streaming a 1 MiB blob 300 times retained ~300 MiB in
process.memoryUsage().arrayBuffers while the V8 heap stayed small.

Register the wakeup lazily in pull() and clear it on every terminal
or idle path (EOS, error, cancel, backpressure), mirroring the
cleanup already done by the async iterator path. The strong handle
now only lives while a pull is in flight, so the reader and its
backing store become collectable once the stream finishes, errors,
is cancelled, or goes idle under backpressure.

Fixes: #63574

Signed-off-by: semimikoh <ejffjeosms@gmail.com>
PR-URL: #63577
Fixes: #63574
Reviewed-By: James M Snell <jasnell@gmail.com>
Signed-off-by: Kirill Saied <sayed.kirill@gmail.com>
PR-URL: #64317
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@pull pull Bot locked and limited conversation to collaborators Jul 9, 2026
@pull pull Bot added the ⤵️ pull label Jul 9, 2026
@pull pull Bot merged commit 7036199 into adamlaska:main Jul 9, 2026
0 of 3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants