title: dealloc doesn't seem to release all image memory
body: <p>An application I am making keeps running into "Memory Warnings", and eventually crashes. It seems that the memory is not freed when release is called on custom view controller classes I have created whose views have been added as subviews.</p>
  
  <p>Here's an example of my situation:</p>
  
  <p>I have created a view controller with an accompianing .xib (to add a sort of popover/menu that allows the user to select a video to play). A button in the top right hand corner of the screen/app calls a function which allocs a new instance of a videoMenu class I created, then adds it's view as a subview. When the user selects a video, a function is called to hide the popover/menu's view, then releases the instance (before displaying/playing the video). If the menu is "open" and the button is pressed again, I have it set up to act like a close button (hiding and then releasing the menu) ... i.e. it toggles the menu.</p>
  
  <p>If I keep pressing the button, the menu appears, and then hides/releases ... over and over ... which is expected. I have noticed though in Instruments->Allocations that when the release is called, the allocations do not decrease. The allocations just keep increasing as I open/close/open/close/etc., as if the release doesn't actually free up memory. I've added an <code>NSLog</code> in the <code>dealloc</code> of the menu to ensure that <code>dealloc</code> is in fact being called.</p>
  
  <p>I have noticed that if I call <code>[videoMenu.view removeFromSuperview]</code> before calling <code>[videoMenu release]</code>, the allocation does in fact reduce.</p>
  
  <p>Is <code>removeFromSuperview</code> the solution?
  Is it necessary?</p>
  
  <p>The .xib file has many <code>UIImageViews</code> in it, and I am also wondering if they are the reason that the allocation continually increases (in my example outlined above) ... meaning do the same images just keep getting cached over and over?</p>