For a further back and remember.
https://stackoverflow.com/questions/55985405/gc-taking-32-of-runtime-expected
https://www.alibabacloud.com/blog/better-node-application-performance-through-gc-optimization_595119
- https://marmelab.com/blog/2018/04/03/how-to-track-and-fix-memory-leak-with-nodejs.html
- https://developer.chrome.com/docs/devtools/memory-problems/memory-101/
https://medium.com/voodoo-engineering/nodejs-internals-v8-garbage-collector-a6eca82540ec
https://community.risingstack.com/the-worlds-fastest-javascript-memoization-library/
I have used a basic http.batch test from k6.
After the basic setup, run the test like this (assuming you ares running in k6 docker):
docker run --add-host=host.docker.internal:host-gateway -i loadimpact/k6 run --vus 3 --duration 400s --user-agent="Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; SCH-I535 Build/KOT49H) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30" - <{{script-name}}.jsobs: the user-agent is to run like a mobile site.
So, afeter running one time, take one snapshot, repare the amount of memory(MB) used from the Heap, and run again.
If the second Heap snapshot uses more memory (relevant one, not just 0.1MB), probably we have a leak.