Is it possible for a programmer to programmatically start/stop the garbage collection in C# programming language? For example, for performance optimization and so on.
Is it possible for a programmer to programmatically start/stop the garbage collection in C#
Share
Not really. You can give the
GChints via methods likeGC.AddMemoryPressureorGC.RemoveMemoryPressurebut not stop it outright.Besides, garbage collection is not that intensive of a process. Programmers very rarely ever worry about it.