Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20446] iOS: HTTPClient fails to deallocate

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionDuplicate
Resolution Date2017-04-13T05:32:12.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labels5.1.0, 5.2.0, HttpClient, ios, leak
ReporterMike Stancliffe
AssigneeVijay Singh
Created2016-02-18T21:39:19.000+0000
Updated2017-05-31T23:17:42.000+0000

Description

HTTPClient iOS fails to deallocate. running the sample app below and using instruments, TiNetworkHTTPClientProxy never goes down, even after status is DONE, slowly eating up memory See this behaviour in 5.2.0 RC(5.2.0.v20160216202526) as well as 5.1.2
var win1 = Titanium.UI.createWindow({  
    backgroundColor:'#fff'
});

var label1 = Titanium.UI.createLabel({
	color:'#999',
	text:'Ping Test',
	font:{fontSize:20,fontFamily:'Helvetica Neue'},
	textAlign:'center',
});

win1.add(label1);

function ping() {

  var pingTimeStart = (new Date).getTime();
  var pingTimeEnd = 0;
  var url = 'http://www.google.com/';
  var pingTest = Ti.Network.createHTTPClient();


  pingTest.onload = function(e) {
    pingTimeEnd = (new Date).getTime();
    Ti.API.warn('PING COMPLETE : '+(pingTimeEnd-pingTimeStart));
  };
  pingTest.onerror = function(e) {
    pingTimeEnd = (new Date).getTime();
    Ti.API.error('PING FAIL : ' + (pingTimeEnd - pingTimeStart));
  };

  pingTest.open("HEAD", url);
  pingTest.timeout = 2000;
  pingTest.send();
}


var pingAway = setInterval(function() {
    ping();
  }, 10000);

win1.open();

Comments

  1. Vijay Singh 2017-04-13

    This is duplicate of TIMOB-24364.
  2. Lee Morris 2017-05-31

    Closing ticket as duplicate.

JSON Source