Uh oh!
There was an error while loading. Please reload this page.
diagnostics_channel: fix diagnostics channel memory leak - #45633
Conversation
ae3c2f9 to
2026e9cCompareQard
commented
Nov 26, 2022
LGTM. Not really how users are intended to use diagnostics_channel, but how users are meant to use things and how they actually use them doesn't always match, so seems like a reasonable fix to me. 😅 |
nodejs-github-bot
commented
Nov 27, 2022
RaisinTen
commented
Nov 27, 2022
Could you add a test for this? Maybe by comparing the values of |
theanarkh
commented
Nov 27, 2022
I think it is difficult to do that, do you have any idea? Thanks! |
RaisinTen
commented
Nov 28, 2022
I meant using the code you shared in the PR description with a slight modification - asserting that the value of // Flags: --expose-gc'use strict';// This test ensures that diagnostic channel references aren't leaked.require('../common');const{ ok }=require('assert');const{ subscribe, unsubscribe }=require('diagnostics_channel');functionnoop(){}constheapUsedBefore=process.memoryUsage().heapUsed;for(leti=0;i<1000000;i++){subscribe(String(i),noop);unsubscribe(String(i),noop);}gc();constheapUsedAfter=process.memoryUsage().heapUsed;ok(heapUsedBefore>=heapUsedAfter);Is it difficult because it's too flaky? |
2026e9c to
cf83822CompareUh oh!
There was an error while loading. Please reload this page.
cf83822 to
4fb75ceComparenodejs-github-bot
commented
Nov 29, 2022
nodejs-github-bot
commented
Nov 29, 2022
nodejs-github-bot
commented
Nov 29, 2022
Landed in d579bc1 |
PR-URL: #45633 Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
PR-URL: #45633 Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
PR-URL: #45633 Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
PR-URL: #45633 Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>

fix diagnostics channel memory leak.
cc @Qard
make -j4 test(UNIX), orvcbuild test(Windows) passes