Results 1 to 4 of 4
  1. #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?

  2. #2
    Administrator
    Join Date
    Feb 2012
    Location
    Bologna, Italy
    Posts
    92
    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

  3. #3
    Quote Originally Posted by gianluca.bertani View Post
    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.

  4. #4
    Administrator
    Join Date
    Feb 2012
    Location
    Bologna, Italy
    Posts
    92
    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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 10:36 PM.