Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14097] BlackBerry: Proxies are never collected by GC

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-08-28T17:44:18.000+0000
Affected Version/sRelease 3.1.1, Release 3.2.0
Fix Version/s2013 Sprint 15 API, 2013 Sprint 15, Release 3.1.2, Release 3.2.0
ComponentsBlackBerry
Labelsqe-3.1.2, qe-testadded
ReporterJosh Roesslein
AssigneePedro Enrique
Created2013-06-04T00:47:35.000+0000
Updated2013-10-01T21:32:02.000+0000

Description

The proxy objects are never being collected by the V8 engine. We appear to be using Persistent handles, but never make them weak or setup callbacks to properly dispose of them once the JS object is unreachable.

Test Case

setInterval(function() {
  Ti.UI.createView();
}, 500);
If you run the above test case and monitor the memory usage, you will see it continue to go up with out any collections.

Comments

  1. Josh Roesslein 2013-06-13

    Here's another test case which opens / closes a window with a bunch of labels:
       var win = Ti.UI.createWindow();
       
       function openWin() {
       	var win = Ti.UI.createWindow({
       		backgroundColor: 'red'
       	});
       	
       	for (var i = 0; i < 100; i++) {
       		var label = Ti.UI.createLabel({
       			text: 'Label #' + i
       		});
       		win.add(label);
       	}
       	
       	setTimeout(function() {
       		win.close();
       		win = null;
       	}, 1000);
       	
       	win.open();
       }
       
       setInterval(openWin, 3000);
       
       win.open();
       
       
  2. Lokesh Choudhary 2013-08-13

    Verified the fix by running the test code provided & its working as expected. Thus closing. Environment: Appcel Studio : 3.1.2.201308091728 Ti SDK : 3.1.2.v20130809141556 Mac OSX : 10.8.4 Alloy : 1.2.0-alpha6 CLI - 3.1.2-alpha win 7 Win 8 Z10 BB simulator : 10.0.10.822 Z10 device running 10.0.10.88 Q10 Simulator : 10.1.0.1720 Q10 Dev alpha C device running 10.1.0.138
  3. Ingo Muschenetz 2013-08-29

    Re-closing. Reopened to fix priority.
  4. Samuel Dowse 2013-10-01

    Verified the fix, app does exactly what is expected. Environment: Titanium Studio, build: 3.1.3.201309132423 Titanium SDK: 3.1.3.GA BB SDK: 10.2.1 Mac OSX : 10.8.5 Alloy : 1.2.2 Z10 BB simulator : 10.2.1 Z10 device running 10.0.10.88

JSON Source