May 2010
Intermediate to advanced
1272 pages
61h 18m
English
The System.GC class provides several methods for manually interacting with the garbage collector. In this chapter you already learned some of them. Remember Collect that enables forcing a garbage collection; WaitForPendingFinalizers enabling to wait for all Finalize methods to be completed before cleaning up resources; ReRegisterForFinalize that puts an object back to the finalization queue in object resurrection; and SuppressFinalize that is used in the Dispose pattern for avoiding unnecessary finalizations. There are other interesting members; for example, you can get an approximate amount of allocated memory as follows:
Dim bytes As Long = System.GC.GetTotalMemory(False)
You pass False if you do not want ...
Read now
Unlock full access