Understanding Garbage Collection and hunting Memory Leaks in Node.js

⇒ Applying Memory Monitoring with Climem

→ Install Climem


→ Executing

  1. Nest.js: CLIMEM=8999 node -r climem dist/main.js
    1. Express: CLIMEM=8999 node -r climem index.js
  2. npx climem 8999

→ AutoCannon // Trigger many requests in sequencie

We can simulate a large amount of requests to check our application performance. For this, we can use Autocannon command as example below:

npx autocannon -c 100 -d 30 -p 10 <http://localhost:3003/*endpoint*>

More commands can be found in the Autocannon documentation:

autocannon



⇒ Understanding Memory Leaks