27

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.

  • 2
    This should be posted in apple.stackexchange.com – Charlie Dec 11 '13 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. – terdon Dec 12 '13 at 5:36
  • 1
    I 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. – Charlie Dec 12 '13 at 17:06
  • 1
    Why did Community protect this question? What answers were deleted? – gparyani Dec 24 '13 at 4:50
  • 1
    For 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 Perrin Jan 27 '14 at 7:12
32

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). 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
  • 5
    Note that, to get it back you can use: sudo nvram boot-args="vm_compressor=4" – James Antill Apr 25 '14 at 1:29
  • 1
    I'd assume that sudo nvram -d boot-args would also revert it to its default. – Feuermurmel Apr 26 '15 at 11:12
  • 1
    FYI: 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. – gojomo Aug 6 '15 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 C Oct 24 '15 at 23:18
  • 2
    I found a way: it doesn't crash if I shut down after logging out, so that worked out for saving the nvram setting – Radu C Oct 25 '15 at 16:18

protected by Community Dec 18 '13 at 20:33

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.