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.
Since .NET 4.6 it's possible, there are methods in the GCclass:
GC
GC.TryStartNoGCRegion(...) and GC.EndNoGCRegion().
GC.TryStartNoGCRegion(...)
GC.EndNoGCRegion()
2.1m questions
2.1m answers
60 comments
57.0k users