5 Tips and Techniques for Avoiding Automatic Garbage Collections

added by dpeterson
11/4/2011 9:51:31 AM

5 Kicks, 308 Views

We've seen a few articles lately on ensuring that your memory is properly cleaned up during garbage collection, but today Michael McLaughlin comes in with tips to avoid automatic collection of your objects. Generally speaking, this is for performance reasons. Garbage collection in .Net 4 and earlier happens automatically and blocks program execution, which can be disastrous for certain types of applications (games, real-time analysis, etc).


11/4/2011 11:40:27 AM
In my opinion, full GC is expensive. GC0 should not take much time.

11/4/2011 7:42:43 PM
I've seen a lot of these articles (well written mostly, it must be said) about Garbage Collection pitfalls/issues/troubleshooting in .NET... All well and good, you might think. I however am of the opinion a managed language really should do a very good job of managing memory for you in *all* cases, unless you explicitly need to tamper with the GC. Really, aren't we just eliminating one of the main advantages of a managed language otherwise, if the GC isn't doing its job properly?