[Mono-bugs] [Bug 65406][Maj] New - TheadPool leaks RAM

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 6 Sep 2004 18:06:51 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by bmaurer@users.sf.net.

http://bugzilla.ximian.com/show_bug.cgi?id=65406

--- shadow/65406	2004-09-06 18:06:51.000000000 -0400
+++ shadow/65406.tmp.12820	2004-09-06 18:06:51.000000000 -0400
@@ -0,0 +1,47 @@
+Bug#: 65406
+Product: Mono: Runtime
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: bmaurer@users.sf.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: TheadPool leaks RAM
+
+Consider this test case:
+
+using System;
+using System.Threading;
+
+class X {
+	static void Main () {
+		for (int i = 0; i < 1000; i ++)
+			ThreadPool.QueueUserWorkItem (new WaitCallback (Foo), new byte [1024 *
+100]);
+		
+		while (true) {
+			GC.Collect ();
+			Thread.Sleep (1000);
+			Console.Write ("c");
+		}
+	}
+	
+	static void Foo (object state)
+	{
+		
+		Thread.Sleep (200);
+		Console.Write (".");
+	}
+}
+
+Once all the threads are done executing, the memory usage should get very
+small. However, the memory usage stays constant at about 100 MB, meaning
+none of the arrays was feed.