[TIMOB-20614] iOS:Ti proxies are not always released from memory
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2016-04-27T20:27:22.000+0000 |
Affected Version/s | Release 5.2.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Rakhi Mitro |
Assignee | Angel Petkov |
Created | 2016-03-22T10:05:53.000+0000 |
Updated | 2017-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:*
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
[~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.
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?
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.
Ticket is invalid.
Closing ticket as invalid.