Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First, as noted before, use ARC. There is no single thing you could do that will more improve memory management.</p> <p>Whether you use ARC or not, you should always use accessors to access your ivars (except in <code>init</code> and <code>dealloc</code>). As noted by @LombaX, you're setting your ivars incorrectly in <code>viewDidLoad</code>. Using accessors would help this.</p> <p>You should run the static analyzer, which will help you find other memory mistakes.</p> <p>I would suspect that you have an <code>IBOutlet</code> that is configured as <code>retain</code> and that you are not releasing in <code>dealloc</code>. That is the most likely cause of the leaks I'm seeing in your screenshots. ARC will generally make such problems go away automatically.</p> <p>It is very possible that you have a retain loop. This generally would not show up as a leak. You should use <a href="http://www.friday.com/bbum/2010/10/17/when-is-a-leak-not-a-leak-using-heapshot-analysis-to-find-undesirable-memory-growth/" rel="nofollow">heapshot</a> to investigate that. Your leaks are pretty small; they may not be the actual cause of memory warnings. What you want to investigate (with the Allocations instrument) is what is actually significantly growing your memory use.</p> <p>But first ARC. Then accessors. Then remove all build warnings. Then remove all Static Analyzer warnings. Then use the Allocations instrument.</p> <p>Side note: the fact that it says the responsible party is "UIKit" does not mean that this is a bug in UIKit. It just means that UIKit allocated the memory that was later leaked. The cause of the leak could be elsewhere. (<em>That</em> said, UIKit does have several small leaks in it. In general they should not give you trouble, but you may never be able to get rid of 100% of small leaks in an iOS app.)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload