Could you post your code that actually uses that class? I would assume that you are attaching a listener to this class (or lots of instances of this class) and they are of course not being released because something is actively attached to them.
On Wed, Sep 22, 2010 at 11:10 PM, BB <[email protected]> wrote: > Hi all, > I have a big problem with objects that contain events. > > I found out that my application does not free memory when expected if > I use my class as declared: > > Public Class CMyClass > Inherits Object > Private fPropertyOne As String > Private fPropertyTwo As Integer > > Public Event OnSomeEvent(ByRef vSender As Object) > > End Class > > Testing with GC, I've got that creating this objects memory grows and > do not change when exit from the scope, but if I remove the event > declaration, memory get free as I suppose it has to do for the garbage > work. > The problem is very heavy using many objects like that. > I've tried with GC.Collect() but it does not change. > Is there something I should know? :( > > I'm using vb.net 2005 with .net 2.0 > > Thank you! > > EM > >
