Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20042] iOS: TiNetworkHTTPClientProxy Memory Leak

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionInvalid
Resolution Date2015-12-08T18:52:40.000+0000
Affected Version/sRelease 5.0.2
Fix Version/sn/a
ComponentsiOS
Labels5.0, 5.0.0.GA, Ti.network, httpclient
ReporterCameron
AssigneeEric Merriman
Created2015-09-20T15:12:18.000+0000
Updated2017-03-23T21:35:29.000+0000

Description

When creating a Ti.Network.createHTTPClient, after the connection closes, a TiNetworkHTTPClientProxy does not get garbage collected. With repeated calls, they will start to build up to a very large #. 1. Open Instruments 2. Run this code
var myurl = "http://www.google.com";	

var xhrshowsite = Ti.Network.createHTTPClient();

xhrshowsite.onload = function() {
		xhrshowsite = null;
};
	
xhrshowsite.onerror = function() {
		xhrshowsite = null;
};

	
	// open the client
	xhrshowsite.open("GET",myurl);
	xhrshowsite.setTimeout([5000]);
	xhrshowsite.send();
This did not affect pre-5.x SDK.

Comments

  1. Pedro Enrique 2015-12-08

    Marking ticket as invalid. The garbage collection in javascript is lazy, not instant. If you let the app sit for a bit, you'll see the allocations go down. This will not cause problems to the app since the garbage collector will run if the app feels memory pressure as well.
  2. Lee Morris 2017-03-23

    Closing ticket as invalid with reference to the previous comments.

JSON Source