0

Memory keeps on increasing in my ARC enabled project and no leaks are being shown in Leaks. Need help on this to find out the issue. I have auto-refresh in a page where views are getting redrawn. I see many objects for CFString - immutable.

Also , see issue in this line.

static NSString *CellIdentifier = @"CustomCell";
        NewsCellView *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

How can I make sure why the views are not getting deallocated and keeps on increasing. How to know who is holding the reference.

Any valuable tips can help. Also, am not setting proper answers in other posts. Need help to debug the issue. iOS Experts pls help.

woz
  • 10,665
  • 3
  • 31
  • 64
user694688
  • 593
  • 1
  • 15
  • 32
  • 4
    can you show the code about how you create your cell maybe the leak is there – Mirko Catalano Nov 05 '13 at 13:45
  • 1
    Allocations instrument, use snapshots and see what is not being released. That's a start. And then you can go back and try to figure out why they are not being released. Memory issues are not only due to leaks. It's very likely that you are retaining strong references to objects that you don't need to be holding on to. – Abizern Nov 05 '13 at 13:46
  • See WWDC 2012 video [iOS App Performance: Memory](https://developer.apple.com/videos/wwdc/2012/?id=242) (paid developer subscription needed) for demonstration on how to use Instruments as suggested by Abizem. – Rob Nov 05 '13 at 14:56

1 Answers1

1

1) Check if you have any cyclic references in your cell. Any strong pointer pointing to parent object or super class.

2) Run the Xcode's "Analyze" tool. Long press the "Run" icon which will show the menu as shown in this image and select the "Analyze" option. It will analyze your code for any possible leaks. Remove the leaks one-by-one and then check if you still have increasing memory.

Saroj
  • 626
  • 6
  • 15
  • in the cell class i have a reference to the table view. Could this be the problem. The analyse tool does not show any leaks as am using ARC. – user694688 Nov 06 '13 at 02:38
  • 1
    just check if the reference variable in cell class is strong/retain. Most likely, It should be 'weak'. – Saroj Nov 08 '13 at 12:26
  • Thanks, it worked after changing reference to weak. But, what is the logic here. I though weak is only for primitive types. Is it not? Can you pls explain the logic here, so that I can understand the concept better – user694688 Nov 08 '13 at 15:24
  • You can see this answer from RDC, http://stackoverflow.com/questions/8927727/objective-c-arc-strong-vs-retain-and-weak-vs-assign – Saroj Nov 12 '13 at 12:24