title: Memory Issue with ARC
body: <p>I've used ARC to build a fairly simple application. However, I'm running into a memory deficiency, but I can't figure out what is causing it. Since I can't clarify what is causing it, I have a few specific details and questions.</p>
  
  <p>The problem ensues when I try to load a new View Controller. This view controller hosts a number of images and, when loaded, will add a 3-4 minute audio file to an <code>AVAudioPlayer</code> in a singleton class I have.</p>
  
  <p>The problem occurs when the view controller is pushed and popped 8-10 times. When the view controller is popped, I call <code>stop</code> on the <code>AVAudioPlayer</code> and return all relevant objects (including the <code>AVAudioPlayer</code> instance) back to nil.</p>
  
  <p>I don't really understand what could be causing the memory leak, or what else could be ravaging the device memory, but I do have a few specific questions.</p>
  
  <p>When stopping the <code>AVAudioPlayer</code>, will that still allow for a proper release in the memory?</p>
  
  <p>Will setting the <code>AVAudioPlayer</code> pointer to nil after calling <code>stop</code> prevent the system from releasing certain data from the device memory?</p>
  
  <p>Shouldn't anything, in ARC, be released when the owner(s) are deallocated (I'm asking about all of the views and data in my <code>UIViewController</code> that gets popped off the stack)?</p>
  
  <p>Are there any issues with <code>AVFoundation</code> or <code>AVAudioPlayer</code> in ARC that I should know?</p>
  
  <p>Is calling <code>stop</code> the wrong way to end an audio session / have it be released?</p>
  
  <p>EDIT: I have started using the instruments tool in order to track my allocations and leaks. There aren't any memory leaks, or so the tool says, but the application will crash, nearly regardless of the live bytes. The application will crash when the total RAM used is over 200MB (210-230MB - my device has 256MB of RAM). My new question is will the total bytes allocated (even if they're not live) affect the memory crashes? If so, how can I prevent this?</p>
  
  <p><a href="http://i.imgur.com/W5hyh.png" rel="nofollow">Here</a> is an image of a run that crashed. You can see the clump of memory warnings at the end.</p>