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 9945 [details]
Xamarin Profiler screen-shot showing the memory consumption increasing
I have observed that using a custom View object, which overrides the OnDraw event, increases application's memory consumption upon each Invalidate() call. This can be reproduced with the project at the "Test Case URL" field. It uses a custom View which does some custom drawing in the OnDraw event. Every time the button is pressed Invalidate() is called for the custom View and the memory consumption increases as can be seen in the Profiler screen-shot attached. Every step in the Allocations chart represents a call to Invalidate(). We have made the same test in Java but have found the memory leak is not present there with Android Studio memory monitor.
This is actually an issue with the profiler. It is currently showing the overall allocations since the start of the app and not how much memory is currently allocated at a given point in time.
This has been fixed in the profiler.
Thanks Narcís for the confirmation.
As per comment 3, this issue has been fixed. Hence I am closing this issue.