# Why is GC Log missing or empty for my Node.js application?

Node.js has no flag that writes garbage collection activity to a file of your choosing. --trace-gc always writes to standard output, so the yc-360 script has to work around that, and the workaround differs by platform.

On Windows, GC Log capture always requires nodejsGCLogPath pointing at your application's redirected output file. There's no automatic discovery on this platform, so if this argument is missing, GC Log will be empty.

On Linux and macOS, the script auto discovers the application's output as long as it was started with --trace-gc. If GC Log is still empty, check that:

  • Your application was actually started with --trace-gc.
  • Enough time has passed in the capture window for a garbage collection cycle to actually run. A short capture window on a lightly loaded process can legitimately show zero events.

nodejsGCLogPath is also a useful override on Linux and macOS if auto discovery isn't finding the right output for your setup. See Configuring Continuous GC Log Capture for the full explanation.