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.
See Question&Answers more detail:osIs it possible for a programmer to programmatically start/stop the garbage collection in C# programming language? For example, for performance optimization and so on.
See Question&Answers more detail:osSince .NET 4.6 it's possible, there are methods in the GC
class:
GC.TryStartNoGCRegion(...)
and GC.EndNoGCRegion()
.