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
Developer Community or GitHub 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 5026 [details]
Reproduces the memory leak
Calling Dispose() on an NSImage (to free up its memory) does not work, and leaves the image data in memory.
It seems like there have been recent changes to the way Dispose/Finalizers work, and it does not seem to function correctly.
The attached sample can demonstrate the scenario that I am running into, where we are creating the NSImage, drawing it, then disposing it.
NOT calling dispose eventually frees up the memory when it is garbage collected, but this is not an option as the image data takes up a large chunk of memory and causes the memory usage to fluctuate quite drastically in the application.
Sorry for the unacceptably long delay in respond. We're working on being better at that in the future. This appears to be fixed on my local build. I can hold down space bar and the memory usage quickly levels off.
Please reopen if you run into this (or have another scenario that can reproduce.