Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4892] tableview SetData not releasing memory

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionCannot Reproduce
Resolution Date2011-08-09T22:18:54.000+0000
Affected Version/sn/a
Fix Version/sSprint 2011-32
ComponentsiOS
Labelssetdata, tableview
ReporterDaniel de Andre
AssigneeSabil Rahim
Created2011-06-27T07:50:26.000+0000
Updated2017-03-31T17:27:53.000+0000

Description

If you use setdata on IOS the tableviewrow dont release. If I compile with 1.7.0 Release Candidate there is no problems. This only appears if I try to compile to 1.7.0 final or 1.7.1. Using Intruments its clear the behavior difference between 1.7 RC and 1.7.1 and 1.7.0 Test case bellow:
var win = Titanium.UI.createWindow(
{
    title: 'Tableview Test'
});
var runNumber = 0;
var tableview = Titanium.UI.createTableView({
	backgroundColor: 'white',
	border: 1,
	borderColor: '#E0E0E0',
	width: 315,
	height: 450,
	left: 35,
	top: 75,
	allowsSelection: true,
	separatorStyle: Ti.UI.iPhone.TableViewSeparatorStyle.SINGLE_LINE
	});
	
win.add(tableview);

var buttomSetData = Titanium.UI.createButton({
	title: 'Set data',
	bottom: 50,
	right: 480,
	border: 1,
	height: 100,
	width: 47
});

buttomSetData.addEventListener('click', function (e) {
var tableviewData =[];
	
for(var i=0;i<200;i++)
{	
	var row1 = Ti.UI.createTableViewRow();
	var infoLabel = Titanium.UI.createView({
				height: 12,
				width: 12,
				//backgroundImage :'images/delrow.png',
				backgroundColor: 'red',
				top: 8,
				left: 20
			});
			
	var textLabel = Ti.UI.createLabel({
			color: '#000',
			text: 'Run number ' + runNumber  + ' Row number '  + i,
			font: {
				fontSize: 15
			},
			top: 5,
			left: 50,
			height: 20,
			width: 260
		});		
			row1.add(textLabel);
			row1.add(infoLabel);
		tableviewData.push(row1);	
			
}			
tableview.setData(tableviewData);

runNumber++	
});
win.add(buttomSetData);
win.open();

Comments

  1. Paul Dowsett 2011-08-04

    Thanks for raising this ticket. Please remember to state the build date and hash of the Titanium SDK you have tested. You will find this information in the log on application launch. Please read the [Jira Ticket Checklist](http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-Summary%3AJiraTicketChecklist) for future tickets. Cheers
  2. Sabil Rahim 2011-08-09

    Checked Against 1.7.2 release and 1.8 master cannot reproduce.
  3. Sabil Rahim 2011-08-09

    Tested against 1.7.2 release and 1.8 master
  4. Tim Poulsen 2011-10-12

  5. Daniel de Andre 2011-10-24

    To be honest, I have no idea how you 'cannot reproduce'... Just open instruments and you will see it. I will stay with 1.7.0 RC until this is fixed.
  6. Tim Poulsen 2012-01-31

    I have tested with both the customer's code and the code I supplied using 1.8.1 and I cannot reproduce the leak. The object count grows till it hits a threshold and then objects are garbage collected as expected. I tried attaching a screen to the ticket, but it didn't seem to work. Here's a screen shot of Instruments showing my testing session using the customer's code. https://skitch.com/skypanther/g7quq/screen-shot-2012-01-31-at-3.34.47-pm You can see memory use grow, then objects are GC'd, and memory then drops.
  7. Lee Morris 2017-03-31

    Closing ticket as I am unable to reproduce the issue using the following environment; iPhone 7 (10.2) MacOS 10.11.6 (15G31) Studio 4.8.1.201612050850 Ti SDK 6.0.3 GA Appc NPM 4.2.8 Appc CLI 6.1.0 Ti CLI 5.0.11 Alloy 1.9.5 Arrow 1.10.1 Xcode 8.2 (8C38) Node v4.6.0 Java 1.7.0_80

JSON Source