i have this small piece of code where i would expect that the GC at a certain point would wipe the memory, instead i run out of memory.
Is this a correct behaviour for the GC?
Private Sub Form1_Load()
Dim WasterWrapper as cMyClass
For MapIndex = 1 To 50
WasterWrapper = New cMyClass
Next
End Sub
this is the class which allocates memory
Public Class cMyClass
Private mArry(,) As Double
Sub New()
Dim i As Integer
Dim j As Integer
ReDim mArry(5000, 5000)
For i = 0 To 5000
For j = 0 To 5000
mArry(i, j) = Rnd() * 1000
Next
Next
End Sub
Protected Overrides Sub Finalize()
MsgBox("Finalising the wrapper")
MyBase.Finalize()
End Sub
End Class