-
May 22nd, 2013, 07:35 PM
#1
ARC memory management
Hi,
I have create app with ls in automatic reference counting (ARC) mode and use ls in tow UIViewController , but when switch between those controller, memory was increase and do not decrease , however i override dealloc method and set to nill all my objects , also I'm close LSClient ([client closeconnection]) , but it seems client not released.
Anyone has idea?
-
May 27th, 2013, 11:29 AM
#2
Hello Ebrahim,
the LS client library for iOS is compatible with ARC and has no special memory management needs, just common retain/release practices. In particular, the LS client retains the delegate passed on the openConnectionWithInfo method and releases it on closeConnection. Similarly, table delegates are retained on subscribeTable/subscribeItems and released on unsubscribeTable.
So, pay attention you do the clean up in the correct order to avoid memory leaks:
1) unsubscribe tables
2) close the LS client connection
3) set LS client to nil
4) remove the view controller
Hope this helps.
Best regards,
Gianluca
-
May 27th, 2013, 07:49 PM
#3
![Quote](images/styles/AestheticaGreen/misc/quote_icon.png)
Originally Posted by
gianluca.bertani
Hello Ebrahim,
the LS client library for iOS is compatible with ARC and has no special memory management needs, just common retain/release practices. In particular, the LS client retains the delegate passed on the openConnectionWithInfo method and releases it on closeConnection. Similarly, table delegates are retained on subscribeTable/subscribeItems and released on unsubscribeTable.
So, pay attention you do the clean up in the correct order to avoid memory leaks:
1) unsubscribe tables
2) close the LS client connection
3) set LS client to nil
4) remove the view controller
Hope this helps.
Best regards,
Gianluca
Hello Gianluca,
I do all of thing , and check memory for my application , the LS is released but with 10 or 15 second delay.
-
May 28th, 2013, 10:46 AM
#4
Hello Ebrahim,
this is to be considered normal behavior, since a few internal housekeeping timers may keep a retain on the LS client or its internal structures for a few seconds. These retains get released as soon as the the timers fire.
Best regards,
Gianluca
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 03:37 PM.
Bookmarks