Triggering a .NET garbage collection externally

Ian G picture Ian G · Sep 19, 2008 · Viewed 8.7k times · Source

Is there a way to trigger a garbage collection in a .NET process from another process or from inside WinDBG?

There are the Managed Debugging Assistants that force a collection as you move across a native/managed boundary, and AQTime seems to have button that suggests it does this, but I can't find any documentation on how to do it.

Answer

Eric Boumendil picture Eric Boumendil · Feb 2, 2016

Answered in another question :

Basically, use PerfView:

PerfView.exe ForceGC [ProcessName | Process ID] /AcceptEULA

It's not intended for production use.