Summary

Understanding how memory and resources are released after object usage is fundamental in every development environment. In .NET, this is accomplished by the garbage collector, a complex mechanism that works after you set an object reference to Nothing or when you attempt to create new instances of objects but don’t have any more memory available. You can also implement explicit destructors, such as Finalize or Dispose, according to specific scenarios in which you do need to release external or unmanaged resources before destroying an object.

Get Visual Basic 2015 Unleashed 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.