Mac OS X has a very excellent memory management and it's way better than Windows. IMHO, it's better than certain Linux distribution like Ubuntu too. I used Ubuntu and it sucks especially after Canonical putting Unity in. Good job, Canonical. I by all means does not address this to other Linux distributions. Some of them are great such as ArchLinux. I'm just disappointed with the new Ubuntu.

Ok enough with the introduction, let's move to the main story. Let's get started with what is memory? In this post, memory may refer to Random Access Memory (RAM), virtual memory, wired memory or file cache.

In Mavericks the Activity Monitor UI is revamped making it looks so different from previous releases. Refer the image below.


Understanding the Activity Monitor's Memory Tab

Four types of memory appear in the Memory tab's: Physical Memory, Virtual Memory, File Cache, and Wired Memory. Physical memory (RAM) is the high-speed memory used to store information that is in use or used most recently. Information in RAM is loaded from the Mac's drive at startup and when applications and documents are opened. Refer the diagram below.


Physical Memory

Physical Memory is RAM and it exists physically and can be seen and touched. Shown in the diagram is the total amount of RAM installed in my computer which is 8GB.

Memory Used

Memory Used indicates the amount of RAM that is currently being used by the apps and system. This does not include virtual memory usage.

Virtual Memory

Virtual Memory is a portion of hard drive that is being used as a memory in case the physical memory is full or runs out. Having those informations transferred from RAM to disk does cost us performance issue since hard drive are much much slower compared to RAM. This virtual memory also referred as swap file or paging file.

Swap Used

Swap Used is the amount of virtual memory used. Having zero swap used is good since no virtual memory is being utilised.

App Memory

App Memory is the amount of RAM that is being used by apps and system processes. No virtual memory involved.

File Cache

File Cache shows physical memory that is being used to speed up access to recently used files. For example, if you've been using Mail and then quit it, the RAM that Mail was using is marked as Inactive memory. Inactive memory is available for use by another application, just like Free memory.  However, if you open Mail before its Inactive memory is used by a different application, Mail will open quicker because its Inactive memory is converted to Active memory, instead of loading it from the slower drive.

Wired Memory

Wired Memory is information in RAM that can't be moved to the Mac's drive. The amount of Wired memory depends on the applications you are using. Wired memory (also called resident memory) stores kernel code and data structures that must never be paged out to disk. Applications, frameworks, and other user-level software cannot allocate wired memory. However, they can affect how much wired memory exists at any time. For example, an application that creates threads and ports implicitly allocates wired memory for the required kernel resources that are associated with them.

Compressed

Compressed shows physical memory used to store a compressed version of data that has not been used recently.


The beauty of Mac OS X is they consume the memory efficiently resulting in less memory being wasted. Even though it seems like all the RAM are being used and we can barely see any amount of RAM left unused, it's a good news actually since unused RAM is a wasted RAM.