Ricky Leeks presents:
How to avoid avoiding automatic garbage collection
The garbage collector is a brilliant piece of software engineering, but sometimes collections occur at inconvenient times. If you need to write high performance, real-time code, you generally want to avoid GC collections during times where execution speed is critical.
Of course, sometimes GC collections are unavoidable, in which case it is best to try to minimize the duration of individual collections. While there is some overlap between optimizing to minimize GC frequency and optimizing to minimize GC latency, the two goals can also collide.
Understanding a bit more about how .NET's memory management works can help you with both paths, but generally the best rewards come from using memory analysis tools like ANTS Memory Profiler to understand what is causing garbage collections to run.