JSDom, when run with { runScripts: 'dangerously' } or { runScripts: 'outside-only' }
exhibits a severe memory leak.
git clone https://github.com/damienwebdev/jsdom-repro.git
npm ci
node main.js
ab -c 1 -n 1000 http://localhost:4000
node --inspect main.js
node --trace-gc main.js
node --expose-gc main.js
As a debugging attempt to try and understand why memory isn't being recovered, I've added a few other examples: