Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7644] iOS: Memory is not being released when a tab is removed from tabGroup

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2012-06-27T12:16:54.000+0000
Affected Version/sRelease 1.8.1
Fix Version/sSprint 2012-04, Release 2.0.0, Release 2.1.0, Release 1.8.2
ComponentsiOS
Labelsmemory, module_tabgroup, qe-testadded, tab
ReporterSandeep Bhimavarapu
AssigneeMax Stepanov
Created2012-02-14T10:08:01.000+0000
Updated2012-06-28T17:30:44.000+0000

Description

Memory is not being released when a tab is removed from a tabGroup on iOS using 'removeTab'. *Sample Code* {noformat} // create tab group var tabGroup = Titanium.UI.createTabGroup(); // create base UI tab and root window var win1 = Titanium.UI.createWindow({ title:'Tab 1', backgroundColor:'#fff' }); var tab1 = Titanium.UI.createTab({ icon:'KS_nav_views.png', title:'Tab 1', window:win1 }); var label1 = Titanium.UI.createLabel({ color:'#999', text:'Remove Tab1', font:{fontSize:20,fontFamily:'Helvetica Neue'}, textAlign:'center', width:'auto' }); label1.addEventListener('click', function() { tabGroup.removeTab(tab1); label1 = win1 = tab1 = null; }); win1.add(label1); // create controls tab and root window var win2 = Titanium.UI.createWindow({ title:'Tab 2', backgroundColor:'#fff' }); var tab2 = Titanium.UI.createTab({ icon:'KS_nav_ui.png', title:'Tab 2', window:win2 }); var label2 = Titanium.UI.createLabel({ color:'#999', text:'I am Window 2', font:{fontSize:20,fontFamily:'Helvetica Neue'}, textAlign:'center', width:'auto' }); win2.add(label2); // add tabs tabGroup.addTab(tab1); tabGroup.addTab(tab2); // open tab group tabGroup.open(); {noformat} *STEPS TO REPRODUCE* - Drop the above sample code into app.js. - Start the application and open Instruments to profile it. - Click the 'Remove Tab1' label. - Search for 'proxy' in instruments and it can be seen that tab proxy(along with window and label proxies inside tab1) are not released even if memory warnings are simulated. *EXPECTED BEHAVIOR* Proxies related to tab and elements inside it should be released. *OBSERVED BEHAVIOR* Memory is not being freed.

Attachments

FileDateSize
Instruments Correct Screenshot.png2012-03-19T09:04:39.000+0000200719

Comments

  1. Neeraj Gupta 2012-02-21

    Please do not reopen resolved bugs if you need them in another branch.
  2. Stephen Tramer 2012-02-22

    Issue persists. Reproduction steps: 1. Launch code above 2. Click "Tab 2" 3. Click "Tab 1" 4. Click "Remove tab1" *PASS*: 1 of: TiUIWindowProxy, TiUITabProxy, TiUILabelProxy
  3. Max Stepanov 2012-02-22

    Step #5: Click "Simulate Memory Warning"
  4. Dustin Hyde 2012-03-19

    Closing as Fixed. SDK: 2.0.0.v20120319003254 Studio: 2.0.0.201203182248 OS: Snow Leopard Devices Tested: iPhone4S 5.0.1 Attached Success Screenshot: Instruments Correct Screenshot.png
  5. Michael Pettiford 2012-04-18

    reopening/closing to add/remove labels
  6. Anshu Mittal 2012-06-27

    The memory is not being released for the objects: TiUIWindowProxy, TiUITabProxy, TiUILabelProxy Tested on SDK:2.1.0.v20120625134154 Tested on Studio:2.1.0.201206251749 Devices:iPad3(5.1), iphone 3GS(5.0.1) OS: OSX 10.7.3 This was working fine on 2.0.2
  7. Max Stepanov 2012-06-27

    PR pending https://github.com/appcelerator/titanium_mobile/pull/2479
  8. Vishal Duggal 2012-06-27

    Fixed by PR 2479 on master and PR 2480 on 2_1_X
  9. Michael Pettiford 2012-06-27

    Closing issue: Tested with Ti Studio build 2.1.0.201206251749 Ti Mobile SDK 2.1.0.v20120627121617 hash r06667517 OSX Lion 10.7.3 iPhone 4S OS 5.0.1 Expected behavior is shown. Note it can take a few minutes on device for the living memory to drop to 1.

JSON Source