-
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
stream: fix memory usage regression in writable #53188
Conversation
Review requested:
|
Actually the condition is equivalent. I'll need to dig deeper. |
eb34ffd
to
7b9f16b
Compare
7b9f16b
to
24b2499
Compare
Ok, I found the culprit. Ready for review. Can you suggest how to add a test? |
Good question, I'm honestly not so sure - you can test writecb is set to null in onwrite but I'm not sure that tests something useful. We don't have memory benchmarks I'm aware of though that might be a good idea overall. |
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
However this is not a memory leak, because the memory consumption is stable.
I would recommend we change the commit/PR title to "stream: fix memory usage regression in writable".
A test for this would be nice but I'm at a loss on how to write it. |
24b2499
to
aec133f
Compare
Done. |
Setting writecb and afterWriteTickInfo to null did not clear the value in the state object. Amends 35ec931 (stream: writable state bitmap). Fixes nodejs#52228.
aec133f
to
61da0ed
Compare
smartos build fails, unrelated to my changes. |
Landed in 78a326e |
Thanks! What's the process of backporting? Should I cherry pick and create a new PR for 22 and 20? |
@orgads Since we didn't put labels like "do not land", this PR is automatically eligible to be included in older versions, just wait for the next version, the releasers will include this PR. You only need to create backport when releasers find a conflict that doesn't allow them merge it easily. /cc @nodejs/releasers Just to let you know guys an important fix for memory usage on streams was merged. |
Setting writecb and afterWriteTickInfo to null did not clear the value in the state object. Amends 35ec931 (stream: writable state bitmap). Fixes #52228. PR-URL: #53188 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Setting writecb and afterWriteTickInfo to null did not clear the value in the state object. Amends 35ec931 (stream: writable state bitmap). Fixes nodejs#52228. PR-URL: nodejs#53188 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
@H4ad @marco-ippolito It hasn't been backported to 20.x. :( |
It has not been on the Current enough (2 weeks) to be backported to v20 |
I see. Thanks for the explanation. |
Setting writecb and afterWriteTickInfo to null did not clear the value in the state object. Amends 35ec931 (stream: writable state bitmap). Fixes nodejs#52228. PR-URL: nodejs#53188 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Setting writecb and afterWriteTickInfo to null did not clear the value in the state object. Amends 35ec931 (stream: writable state bitmap). Fixes #52228. PR-URL: #53188 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Setting writecb and afterWriteTickInfo to null did not clear the value in the state object. Amends 35ec931 (stream: writable state bitmap). Fixes #52228. PR-URL: #53188 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Setting writecb and afterWriteTickInfo to null did not clear the value in the state object.
Amends 35ec931 (stream: writable state bitmap).
Fixes #52228.