[Mono-dev] Re: [Mono-osx] anybody noticed a mach port leak?

Allan Hsu allan at counterpop.net
Mon Jun 12 18:20:21 EDT 2006

On Jun 8, 2006, at 7:56 PM, Miguel de Icaza wrote:

>> I'm having a hard time tracking down a mach port leak in imeem. Some
>> roundabout debugging leads me to believe it's somewhere in the
>> networking-related portions of either our managed code or the Mono
>> runtime. Has anybody else noticed their mach port counts rising over
>> time? If so, what does your application do?
> A test case narrowing the problem would be the first step.

I've done some more investigation and I've filed a new bug and marked  
the old one as a duplicate of the new one:


It looks like the problem has to do with garbage collection and  
threading and it should effect just about anybody that uses threads  
under Mono on OS X. I attached a rough GC patch to the bug that  
halves the number of ports leaked in some situations, but does not  
entirely fix the problem. The patch also has a lot of whitespace  
changes I made so I could properly read the code (sorry about that).

At this point, I'm not sure what else to do. I'm wondering if the  
rest of the leaks could be caused by another place where  
mach_port_deallocate() isn't being called when it should be. I'm no  
mach expert, so I'm not sure where else to look.

Allan Hsu <allan at counterpop dot net>
1E64 E20F 34D9 CBA7 1300  1457 AC37 CBBB 0E92 C779

More information about the Mono-devel-list mailing list