[Mono-bugs] [Bug 74223][Maj] Changed - memory leaks when creating threads on solaris
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Wed, 6 Apr 2005 11:27:22 -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 vargaz@gmail.com.
http://bugzilla.ximian.com/show_bug.cgi?id=74223
--- shadow/74223 2005-04-01 08:33:12.000000000 -0500
+++ shadow/74223.tmp.25662 2005-04-06 11:27:22.000000000 -0400
@@ -10,14 +10,13 @@
Component: remoting
AssignedTo: vargaz@gmail.com
ReportedBy: jan.reitz@lanxess.com
QAContact: mono-bugs@ximian.com
TargetMilestone: ---
URL:
-Cc:
-Summary: Remoting RPC Call with 2 or more minutes between calls causes memory leak
+Summary: memory leaks when creating threads on solaris
Maybe this Bug is for GC or for remoting.... had to choose one, so its now here
sorry for my english in advance
Description of Problem:
@@ -195,6 +194,25 @@
2202 root 5 24 0 3272K 1200K sleep 0:00 0.00% dmispd
14531 root 1 29 0 1832K 1120K sleep 0:00 0.00% in.telnetd
please tell me how to give you more usefull information.
the program is still running so maybe i can get more info out of it if you
tell me how.
+
+------- Additional Comments From vargaz@gmail.com 2005-04-06 11:27 -------
+Here is what happens:
+-on solaris, the Boehm GC implementation explicitly allocates memory
+for the threads stack. It also uses a helper thread to join each
+exited thread so it can free the stack memory. However,
+timed_thread_start_routine explicitly calls pthread_detach, so the
+helper thread can't join our threads, causing the leaking of the 1MB
+stack for each thread.
+
+A soluation would be to call
+
+pthread_attr_setdetachstate(attr, PTHREAD_CREATE_DETACHED);
+
+in wapi_timed_thread_create () and remove the detach call.
+The GC wrapper for pthread_create () will remove the detached
+attribute on solaris.
+
+Dick is this ok with you ?