MockHttpSocket and MockHttpAgent are not being garbage collected #2405
Labels
bug
Something isn't working
needs:triage
Issues that have not been investigated yet.
scope:node
Related to MSW running in Node
Prerequisites
Environment check
msw
versionNode.js version
22.12.0
Reproduction repository
https://github.com/rossipedia/msw-leak-test
Reproduction steps
Instructions are in the reproduction repo, but they are essentially:
npm install
./demo.sh
Current behavior
Note
This is a follow up to my colleague's issue #2390
Enabling MSW with no handlers and then load-testing using
ab
causes heap usage to balloon, even when manually invoking garbage collection.As best I can tell, the largest percentage of retained objects are primarily:
MockHttpSocket
MockHttpAgent
I do not believe this is related to
express
, as onlyClientRequest
is intercepted, and I don't thinkexpress
orhttp.createServer
useClientRequest
, onlyIncomingMessage
andServerResponse
(I could be wrong about that though).Expected behavior
Memory usage should be stable under load when simply enabling MSW in a node application.
The text was updated successfully, but these errors were encountered: