I'm using ARC. I have UINavigationController to push and pop. It happens that one of the ViewController is a huge scrollview holding up 100MB. After popViewController, the ViewController that contains the scrollview is supposed to release. NSLog shows that dealloc was called. However, the 100MB memory is still occupied. Is it normal?
If dealloc of the viewController get called, does it mean that it's retainCount is already Zero and I'm not leaking the viewController?
Thanks in advance
Ref: Memory not released when popViewController Called APURV is suggesting there is a cache mechanism of iOS that holds up memory. Is that true?
EDIT:
Memory usage was observed from Debug Navigator in Xcode
EDIT2:
I just tried running exactly the same code again. But this time, I have Personal Hotspot of my iPhone ON and have it downloading something continuously. I then run the app again with the same code. I see this:
The spike in the middle is the 100MB scrollview, now if I popViewController, it goes back to 12MB. It makes me think that there's really a cache going on in iOS and is depending on memory availability. When it's out of memory, the cache will be washed away, also, release will then happen immediately.
I will also try to learn to Instrument and post result here later.