Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 1316 [details]
Simple test program that verifies the bug.
When creating an unmanaged COM object and a managed proxy for that, GC does not release the proxy object. COM proxies are freed by GC but not released which results a memory leak in unmanaged side. The behavior is different from Microsoft's .NET runtime which releases COM proxies when GC collects. There is no difference if assembly is compiled with Mono's compilers or Microsoft's .NET compilers. However, assembly compiled with Mono and ran by Microsoft .NET the behavior is correct (COM proxies are released by GC).
Mono runtime seems to release active COM proxies when runtime is cleaned up. So, it does not leak memory every time. Memory is leaked if GC collects, requested manually or automatically, before final runtime cleanup.
This is a COM Interop issue.
Hey John, this is your area, is this a problem mono currently have?
This test depends on precise stack scanning, it won't work on mono.
Closing as we have tests for this that shows this working.