Memory Compression Settings in OSX 10.9

After updating OS X to Mavericks, I noticed context switching between large applications, or having large applications running in the background was significantly slower on the MacBook Air with 4GB of system memory. Enhanced support for memory compression was added in the update, which many sites reported to yield an overall system performance benefit.

Searching around the web, I found methods for disabling the memory compressor entirely. However, I still wanted to benefit from the memory compression if possible. I noticed that the default setting for the compression mode includes compressing the swap backend.

Available values:
1 – VM_PAGER_DEFAULT – Use default pager.
2 – VM_PAGER_COMPRESSOR_NO_SWAP – In-core compressor only.
4 – VM_PAGER_COMPRESSOR_WITH_SWAP – In-core compressor + swap backend.
8 – VM_PAGER_FREEZER_DEFAULT – Freezer backed by default pager.
10 – VM_PAGER_FREEZER_COMPRESSOR_NO_SWAP – Freezer backed by in-core compressor only i.e. frozen data remain in-core compressed.
20 – VM_PAGER_FREEZER_COMPRESSOR_WITH_SWAP – Freezer backed by in-core compressor with swap support too.

Values are from the XNU codebase in Apple’s OpenSource repository:
http://www.opensource.apple.com/source/xnu/xnu-2422.1.72/osfmk/vm/vm_compressor.c
http://opensource.apple.com/source/xnu/xnu-2422.1.72/osfmk/vm/vm_pageout.h

To change the compressor mode run:
code>sudo nvram boot-args="vm_compressor=1"

Reboot for the change to take effect.

To verify the compressor mode run:
sysctl -a vm.compressor_mode

Comments Off on Memory Compression Settings in OSX 10.9

Categories random