Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20614] iOS:Ti proxies are not always released from memory

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2016-04-27T20:27:22.000+0000
Affected Version/sRelease 5.2.0
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterRakhi Mitro
AssigneeAngel Petkov
Created2016-03-22T10:05:53.000+0000
Updated2017-03-20T21:36:52.000+0000

Description

TiViewProxy (and general proxy) objects do not appear to be always removed from memory, and garbage collection (when it occurs) regularly misses proxy objects, even when they are explicitly removed from parent views and nulled. *Test Code:* Reporter’s sample [code](https://www.dropbox.com/s/3zjhjnk1fe27yc2/sampleApp%20%281%29.zip?dl=0). *Test Environment:* Appcelerator Command-Line Interface; 5.2.0 Mac OS X,10.11.1Xcode-7.2.1,iOS SDK: 9.1,iPad Node.js: 0.12.7 npm: 2.11.3 Appcelerator CLI Installer = 4.2.3 Core Package = 5.2.0 Titanium CLI:5.0.6 TI SDK:5.4.0.v20160307212310,5.20GA *Test Steps:*

Import the app

Run it in a IPad device/simulator.

Simply open Instruments 7.2.1 via an iOS 9.2. device

Go>Room with List View>Back to home. Same as Go>Room with View>Back to home.Watch the proxy object numbers go up and down inconsistently as we move back and forth within the same screens repeatedly.

*Test Results:* Check the [link](http://postimg.org/image/q7sz4rtcd/).

Comments

  1. Angel Petkov 2016-03-30

    Hello thank you for the well written ticket , i was able to reproduce the memory leaks. They were caused by a method inside our krollbridge class. PR:https://github.com/appcelerator/titanium_mobile/pull/7894/files
  2. Angel Petkov 2016-04-19

    [~rmitro] Hello, after further investigation there isn't a memory leak taking place, If you were to track all the proxy objects in memory you will see that once you switch back to the main view, they will be discarded. Sometimes it will take sometime longer to discard the items, never the less they will be garbage collected. The memory leaks I thought i was seeing before was actually the delayed data on instruments.
  3. Peter Lancaster 2016-04-20

    Thanks for coming back to us on this - I thought after viewing this presentation by Rick Blalock: https://vimeo.com/29804284 though - this was something we should be able to see fairly immediately in iOS, via Instruments? When you say they are 'eventually' garbage collected - how long do / can objects take to be removed from memory? If this is an issue with Instruments updating - how can we effectively debug memory leaks like this? Do native (swift / objective c) apps suffer from the same lag / delays?
  4. Angel Petkov 2016-04-20

    Hello Peter, thank you for the feedback. When i say delayed i do mean only by the means of couple of seconds, if you were to track all the proxies enter one of the 2 views of the application and exit back. You will see that it does get garbage collected or if it doesn't straight away after one or two seconds it will be. Another way to test it, is to simulate a memory warning , if there was indeed a memory leek you would see more live views. Another factor is that this code is very old and has not been changed for years, so its not possible that a memory leak would appear ,without any new code being added.
  5. Pedro Enrique 2016-04-27

    Ticket is invalid.
  6. Lee Morris 2017-03-20

    Closing ticket as invalid.

JSON Source