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.
note: Please provide full test case(s) if you want advice on something (even more for advice than a bug). We won't recreate applications around code snippets and it's very likely that the issue exists in some missing code.
A quick _guess_ is that the memory is required only temporarily. That's often caused because GetHeightForRow, when overriden, is called for every (not just the visible) cells in the UITableView. Since that's done (by iOS) in a loop it might take some time for the GC to reclaim any memory allocated during the calls (hence the visible memory spike).
Things that often help are:
* Caching some (or even all) height values (.e.g on first use);
* Precompute (and cache) the height for all cells / items, so the call to GetHeightForRow becomes a single "GetItem().Height";
* Ensuring the height computation can be done without (or with few) memory allocation(s);