O'Reilly logo

Mastering iOS 10 Programming by Donny Wals

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Closing memory leaks

Usually, if you navigate around your app, it's normal to see memory usage spike a little. More view controllers on a navigation controller's stack means that more memory will be consumed by your app. This makes sense. When you navigate back, popping the current view controller off the navigation controller's stack, you would expect the view controller to be deallocated and the memory to be freed up.

The scenario above is exactly how our app should work. It's okay if we use some more memory if we're deeper in the navigation stack, but we expect the memory to be freed back up after we've hit the back button.

In the Instrumental app, the memory just keeps growing. It doesn't really matter if you drill deep into the navigation stack, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required