O'Reilly logo

Objective-C Programming: The Big Nerd Ranch Guide by Mikey Ward, Aaron Hillegass

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

Memory management

When we talk about memory management, we are talking about managing heap memory. Consider the difference between the stack and the heap. Recall from Chapter 5 that the stack is an orderly stack of frames. Each frame is automatically deallocated when the function using it ends. The heap, on the other hand, is a heaping pile of memory, and that is where your objects live.

Managing the heap is important because objects can be large and because your program only gets so much heap memory for its own use. Each object that is created takes up some of that memory.

Running low on memory is a problem. It will cause a Mac app to perform badly and will cause an iOS app to crash. Thus, it is essential that any objects that ...

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