1

I am developing an app for the iPhone and am encountering some memory management issues. During execution of the app the live bytes continuously increase without bound. I have tried to track down the issue within my code but cannot seem to find anything that would cause the live bytes to increase so dramatically. The one thing that I have noticed during execution is that the allocation for CFString(Immutable) increase the most rapidly and never decrease or stay constant. Does anyone have any idea why this may be happening? All that the app is doing during this execution is populating a table view from a local array or strings, then downloading another array of string objects and populating a different table view. I am using ARC.

enter image description here

kaiserphellos
  • 253
  • 2
  • 8
  • When you look for leaks, do you see anything there? Or is the live bytes just increasing? If the latter, make sure you don't have any circular logic (e.g. perform modal segue from view controller A to view controller B and do another from B back to A (rather than dismissing B)). See the second point in my answer for tracking down the sources of allocations. – Rob Jan 07 '13 at 22:39
  • @kaiserphellos Is your issue resolved? Can you please let me know what solved your problem? – Pooja M. Bohora Sep 16 '13 at 12:01

1 Answers1

1

Given the lack of anything concrete to go on, I'll give you somewhat general counsel:

  • See Finding leaks with Instruments for guidance on how to use Instruments to find leaks.

  • For specific advice how to go from you allocations, to a more meaningful analysis of the source of those allocations, see point #4 of this Stack Overflow answer. In short, highlight one of your unexplained jumps in allocations, set the bottom window to show you the call tree, hide system libraries, and see in which of your routines the memory is being consumed.

  • Also, don't overlook the static analyzer, which is especially important if you don't use ARC, or if you use any Core Foundation calls.

  • Are you doing anything with Core Foundation functions? If so, you obviously need to know that you either have to explicitly transfer ownership to ARC (with either CFBridgingRelease or __bridge_transfer) or manually call CFRelease. The static analyzer of my prior point would point this out to you, though.

Community
  • 1
  • 1
Rob
  • 415,655
  • 72
  • 787
  • 1,044