[Gtk-sharp-list] Disposing problem

Bruno Fernandez-Ruiz brunofr@olympum.com
Sat, 08 Nov 2003 20:55:44 +0200


--=-x2X+kG/TZ9kmj6lmnGAr
Content-Type: text/plain; charset=iso-8859-15
Content-Transfer-Encoding: 8bit

On Sat, 2003-11-08 at 20:54, Gonçal Carrero Puig wrote:
> Anyone knows why idle is never calling PerformedQueuedUnrefs?

I have seen similar problems in due to the GC thread never entering, and
the heap expanding until memory exhaustion. Try to create many dummy
objects that implement IDisposable, and see if they get reclaimed. When
running the attached sample, I freeze the system and run out of memory.
No collection ever happens. 

Is GC disabled by default in mono?

Bruno

-- 
Bruno Fernandez-Ruiz <brunofr@olympum.com>
The Olympum Group,  http://www.olympum.com

--=-x2X+kG/TZ9kmj6lmnGAr
Content-Disposition: attachment; filename=Test.cs
Content-Type: text/plain; name=Test.cs; charset=iso-8859-15
Content-Transfer-Encoding: 7bit

namespace NS {
using System;
public class Test : IDisposable
{
	public void Dispose ()
	{
		GC.SuppressFinalize (this);
		Console.WriteLine ("Disposed");
	}

	~Test ()
	{
		Console.WriteLine ("Finalized");
	}

	public static void Main ()
	{
		for (long i = 10000000000; i > 0; i--)
 			new Test ();	
	}	
}
}

--=-x2X+kG/TZ9kmj6lmnGAr--