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.
When working on a game using Mono, I've discovered that Array.Sort (And pretty any container class that would call this such as List<T>) generates garbage when called. The qsort call from under the hood allocates a QSortStack array with every call, which can generate a decent amount of garbage. The allocation itself is only ~288 bytes, but a high performing application like a game which can sort elements ~60 times a frame could easily end up generating about a MB a second.
It's also worth mentioning that, while it's not garbage itself since it's a delegate, you could also greatly reduce the amount of allocations that the chain of Array.Sort() does by internally passing the Comparison<T>'s used by ref.
Fixed in master. Although I don't know what you meant by the Comparison<T> comment