Cleaning Up After Yourself

Most developers know that the .NET Framework performs garbage collection, but many developers are unaware of how or when the garbage-collection process occurs. Although this text will not try to provide an in-depth explanation of the inner workings of garbage collection in .NET, it’s important to understand that garbage collection is not performed immediately and how its timing can affect the behavior of your application.

Many .NET developers have experience with Visual Basic 6.0 and prior versions and know that those versions provide aggressive garbage collection. With these "classic" versions of Visual Basic, objects are cleaned up as soon as they fall out of scope or are released by setting the object variable to ...

Get Programming Microsoft® ADO.NET 2.0 Core Reference, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.