Bug 23996 - Implementing a TableView with Variable Height Rows
Summary: Implementing a TableView with Variable Height Rows
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: XI 8.2.0
Hardware: PC Mac OS
: Lowest minor
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-10-22 15:53 UTC by Dominic N [MSFT]
Modified: 2014-11-12 01:11 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:
Status:
RESOLVED NOT_REPRODUCIBLE

Comment 1 Sebastien Pouliot 2014-10-22 16:30:59 UTC
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);