O'Reilly logo

Advanced Mac OS X Programming: The Big Nerd Ranch Guide by Mark Dalrymple

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

Dynamic Memory Allocation

Dynamic memory is memory that comes from the heap. The heap of the program starts off at an OS-defined default amount of space available for program consumption. As you allocate memory from the heap, it fills up, and then your program asks for more memory from the OS. Memory that you have released can be reused by your program. Memory allocated and subsequently freed is still charged to your program by the operating system. If you allocate 50 megabytes for temporary workspace and then free it all, your program will still have the 50 megabytes of memory allocated to it. This will eventually be swapped out to disk (on desktop systems) since you might not be using it. The total amount of memory can be considered a high ...

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