Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9494] iOS:UI.iPhone.NavigationGroup - Opening window added in the Navgroup shows an intermittent behavior while allocating and de-allocating the memory.

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2017-07-10T22:33:01.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sSprint 2012-14 API
ComponentsiOS
Labelsapi, qe-ios060112
ReporterNeha Chhabra
AssigneeEric Merriman
Created2012-06-12T03:12:22.000+0000
Updated2017-07-10T22:33:06.000+0000

Description

Opening window added in the Navgroup shows an intermittent behavior while allocating and de-allocating the memory. This is not a regression.This occurs as far as 1.8.2. Steps to Reproduce: 1. Install the app on device and launch it. 2. Open Developer/Applications/Instruments (Xcode Memory Profiler). 3. Run the app through the profiler (monitor leaks). 4. Choose Target -> Device, and Choose Target -> Choose Target -> App. Press record to run the app. 5. Open each tab in the window (One, Two, Three), and close using the Close button. 6. Open each tab in the window (One, Two, Three), and close using the Home Window button in the nav bar at the top. app.js
var _window = Ti.UI.createWindow({
	backgroundColor : 'blue'
})
// Global namespace
			var App = {};
			// used to simulate global object
			var Global = {};
			
			// Initial Window
			App.homeWindow = Ti.UI.createWindow({
				title: 'Home Window'
			});
			
			// NavGroup
			App.nav = Ti.UI.iPhone.createNavigationGroup({
			   	window: App.homeWindow
			});
			
			// Module loader / helper
			App.loadPage = function(_name, _params) {
				// Private
				var win = Ti.UI.createWindow({ backgroundColor: '#eee' }),
					scrollable = Ti.UI.createScrollableView(),
					close = null;
				
				// simluate exports object	
				Global.exports = {};
				
				// Public
				Global.exports.load = function(_app, _params) {
					win.title = _params.title;
					
					close = Ti.UI.createButton({
						title: 'close',
						width: '50%',
						height: 75
					});
					
					// Closing the window means it will never get released
					// NOTE: It will get released if you hit the auto generated back button.
					close.addEventListener('click', function() {
						_app.nav.close(win);
						// None of these free up memory:
						win = null;
						scrollable = null;
						Global.exports = null;
					});
					
					win.add(scrollable);
					win.add(close);
					
					_app.nav.open(win);
				};
				
				Global.exports.load(App, _params);
			};
			
			/**
			 * Initial page
			 */
			var data = [
				{ title: 'One' },
				{ title: 'Two' },
				{ title: 'Three' },
			];
			
			var table = Ti.UI.createTableView({
				data: data
			});
			
			table.addEventListener('click', function(e) {
				App.loadPage('someModule', {
					title: e.row.title
				});
			});
			
			App.homeWindow.add(table);
			
			_window.add(App.nav);
			_window.open();
Actual Result: At Step 6:The TiUIWindowPoxy variable is not deallocating the memory when windows closes. Also,sometimes it is not even allocating the memory to the variable Expected Result: The TiUIWindowPoxy variable should be deallocated when windows close.

Comments

  1. Sabil Rahim 2012-07-03

    Tested on iPhone Simulator 4.3, 5.0 and 5.1, on device iPhone 4S running 5.1 SDK build : 2.2.0 (master) build cf6f1330469d2238a5ca8f9f374e1312e51fdbe7. Mac OSX 10.7.3
  2. Neha Chhabra 2012-08-23

    Tested with: Titanium Studio: 2.1.2.201208201549 Titanium SDK: 2.1.2.v20120821160113 Titanium SDK: 2.2.0.v20120808154112 The problem of deallocation the memory still occurs.(i.e after following all the steps,one extra living is left for TiUiWindowProxy)
  3. Michael Belkin 2012-08-24

    I'm also experiencing this issue with 2.1.1 GA
  4. Lee Morris 2017-07-10

    Closing ticket due to time passed and lack of progress for a number of years. Please open a new ticket if there are any problems.

JSON Source