---
title: Tracing Node's Garbage Collection
description: In this blog post I'll show you a quick way to peak into Node's garbage collection.
date: 2020-02-21
tags: NodeJS
source: https://brianchildress.co/blog/tracing-node-garbage-collection
---

# Tracing Node's Garbage Collection

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

A simple command: 

```sh
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](https://blog.codeship.com/understanding-garbage-collection-in-node-js/)
