GC.WaitForPendingFinalizers()
Imports System
Imports System.Text
Imports System.Text.RegularExpressions
Public Class MainClass
Shared Sub Main( )
Dim myObject As Object = New Object()
Dim i As Integer
For i = 0 To 3
Console.WriteLine(String.Format("Generation = {0}", _
GC.GetGeneration(myObject)))
GC.Collect()
GC.WaitForPendingFinalizers()
Next i
End Sub 'Main
End Class
Related examples in the same category