Hi, Im new to vb.net but not programming and im having an issue understanding why memory is not being released.
Ive created a class thats similar to binary tree.
pseudo example:
I can create tree's and they work fine, however As I manipulate a tree, any branch may be replaced by a new branch or null (Nothing). (including the root tree)
In other languages that im used to, a sub branch being replaced by a new one or null will effectively cause the old branch and everything attached to it to go out of scope and collected by the GC.
As I work with a single tree the memory usage just keeps growing and growing, Even if i set the "root tree" (my only static variable in the whole app) to nothing.
As a last ditch effort I tried implementing this proc.
This should effectively GC every tTree instance below the current one.
Again, I only have one global tree variable as a root, calling dispose even on this does nothing to relieve the memory leak.
What am i doing wrong?
Ps: Ive checked that there is not something else accumulating like a static string or anything like that.
Thanks
Ive created a class thats similar to binary tree.
pseudo example:
VB.NET:
Public Class tTree
'.. (other simple data types)
public A as tTree
public B as tTree
End class
I can create tree's and they work fine, however As I manipulate a tree, any branch may be replaced by a new branch or null (Nothing). (including the root tree)
In other languages that im used to, a sub branch being replaced by a new one or null will effectively cause the old branch and everything attached to it to go out of scope and collected by the GC.
As I work with a single tree the memory usage just keeps growing and growing, Even if i set the "root tree" (my only static variable in the whole app) to nothing.
As a last ditch effort I tried implementing this proc.
VB.NET:
Public Sub dispose() Implements IDisposable.Dispose
A = Nothing
B = Nothing
End Sub
This should effectively GC every tTree instance below the current one.
Again, I only have one global tree variable as a root, calling dispose even on this does nothing to relieve the memory leak.
What am i doing wrong?
Ps: Ive checked that there is not something else accumulating like a static string or anything like that.
Thanks