Tracing Node's Garbage Collection

02-21-2020

The Chrome V8 engine helps monitor and evaluate garbage collection used in NodeJS.

A simple command:

1
node --trace_gc app.js

By passing --trace_gc we can start to see Scavenge and Mark-sweep calls produced.

For a more in depth understanding of the Node Garbage collector, and why you should care: Node Garbage Collector