[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AW: [Pnet-developers] [bug #16089] Garbage Collector does not call Final
From: |
Heiko.Weiss |
Subject: |
AW: [Pnet-developers] [bug #16089] Garbage Collector does not call Finalizers if using Forms |
Date: |
Tue, 14 Mar 2006 13:33:11 +0100 |
No!
The problem is, that using a Form, none of our objects are destroyed, such as
Hashtables, ArrayLists ...
Our app is getting bigger and bigger.
If a Form is Closed (Disposed) the inner object should be Finalized at a time.
Which does not. And should be Finalized even when calling GC.Collect().
We here are running out of memory :(
Cheers
Heiko
-----Ursprüngliche Nachricht-----
Von: Marc Haisenko [mailto:address@hidden
Gesendet: Dienstag, 14. März 2006 13:28
An: address@hidden
Cc: Weiss, Heiko
Betreff: Re: [Pnet-developers] [bug #16089] Garbage Collector does not call
Finalizers if using Forms
On Tuesday 14 March 2006 12:34, Heiko Weiss wrote:
> The GC does not call the Finalizers, if showing a form and closing it.
> Have attached a small sample.
> Form1:
> Click on button1 -> a 2nd form Form2 is created.
> Form2:
> is using a testclass XXX with Finalizer.
> Close the Form2.
>
> Now click button Collect of Form1.
> The GC should call the Finalizer of class XXX.
>
> BUT is not called.
>
> I think theres a problem with forms only.
> if I use class XXX in a Console-App with new XXX() and do GC.Collect, the
> GC is calling the Finalizer.
> So it must be a bug in using SWF.
>
> Please help urgent!!!
>
> Thx
> Brubbel
This is the normal .NET GC behaviour and totally normal. .NET only guarantees
that finalizers are called at least when the application exits, otherwise you
can't make any assumptions on when they are called.
This is at least a minor improvement to Java which doesn't guarantee that they
are called at all.
So you can't do anything about it, AFAIK
One thing I really, *really* miss is a language with garbage collection where
you can explicitly delete an object with all consequences (call the
destructor, remove memory and clear resources like file handles).
C'ya,
Marc
--
Marc Haisenko
http://darkdust.net
Today is Pungenday, the 73rd day of Chaos in the YOLD 3172
- AW: [Pnet-developers] [bug #16089] Garbage Collector does not call Finalizers if using Forms,
Heiko.Weiss <=