Is there any way to disable memory compression in Mavericks? Ever since I upgraded, my Minecraft server has been using ludicrous amounts of CPU time and choking. I'd like to test without compressed memory to see if that might be the culprit.
-
2This should be posted in apple.stackexchange.com– CharlieDec 11, 2013 at 23:42
-
2@Charlie no it should not. It can be since it would be on topic there but it can also stay since it is perfectly on topic here as well. Please don't tell people to move perfectly valid questions.– terdonDec 12, 2013 at 5:36
-
1I didn't tell anyone to do anything; and this should be posted in the apple stack exchange because it is a strict subset of superuser but specific to mac/apple. Superuser is the catchall for topics that don't fit anywhere else.– CharlieDec 12, 2013 at 17:06
-
1Why did Community protect this question? What answers were deleted?– gparyaniDec 24, 2013 at 4:50
-
1For disabling compressed memory, the accepted answer here is ideal – thanks. In Ask Different: vm_compressor_mode (vm.compressor_mode) values for enabled compressed memory in OS X– Graham PerrinJan 27, 2014 at 7:12
1 Answer
vm/vm_pageout.h defines the modes for the vm_compressor boot argument, which defaults to VM_PAGER_COMPRESSOR_WITH_SWAP (per vm/vm_compressor.c). For OS X 10.9, 10.10, and 10.11, you can disable compression by changing the vm_compressor_mode argument to 1 (VM_PAGER_DEFAULT). That is:
sudo nvram boot-args="vm_compressor=1"
Then reboot. You can verify the change was successful by running:
sysctl -a vm.compressor_mode
Starting with macOS 10.12 Sierra, the old VM_PAGER_DEFAULT is no longer supported and vm_compressor=1
is converted to vm_compressor=4
inside the kernel.
-
5Note that, to get it back you can use: sudo nvram boot-args="vm_compressor=4" Apr 25, 2014 at 1:29
-
1I'd assume that
sudo nvram -d boot-args
would also revert it to its default. Apr 26, 2015 at 11:12 -
1FYI: I had disabled compression in Mavericks, as described here, when it seemed to be interacting poorly with a large-RAM VMWare Fusion guest. After upgrading to Yosemite (10.10.4), I was getting crashes every 10-15 minutes under light web browsing. (Specifically: 1st a mouse freeze, then a reboot about a minute later, attributed in the post-reboot crash report as a "progress watchdog" event.) On a hunch, I reverted to "vm_compressor=4" – and haven't had a Yosemite crash since.– gojomoAug 6, 2015 at 2:20
-
Any idea how to re-enable compression when the Mac crashes on shutdown (or so it claims) and fails to save the nvram setting?– Radu COct 24, 2015 at 23:18
-
3I found a way: it doesn't crash if I shut down after logging out, so that worked out for saving the nvram setting– Radu COct 25, 2015 at 16:18