.netgarbage-collectionperfview

GC on external process


Is it possible to force GC on an external process? I mean without attaching to Visual Studio/windbg etc. I know it might be possible to do it with something like VS Immediate window.

EDITenter image description here It looks like this could be done via PerfView but I could find much info as if this does a full GC or what. Any ideas?


Solution

  • No, neither Windows nor .NET exposes any kind of API you could use to force a GC on a external process without attaching a debugger to it.

    You must attach a debugger and use that route to force a GC.