Along with the CPU, memory is a highly important resource for any application, so Apple recommends that developers carefully plan their memory allocation strategy for a simple reason: these resources are limited, and optimal performance needs efficient memory allocation. The more memory there is for an app, the better it performs, but that usually comes at a cost since that resource is then not there for other apps. Combined with virtual memory, it allows the operating system to get the best out of the available hardware.Įvery application operates in a memory space, where it holds its own code, data, and state. Physical memory is a pivotal resource, and macOS provides developers with various ways to allocate it, depending on their needs.