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.
Asked
Active
Viewed 3.6k times
28
-
2This should be posted in http://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 05: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. – Charlie Dec 12 '13 at 17:06
-
1Why did Community protect this question? What answers were deleted? – gparyani Dec 24 '13 at 04: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](http://apple.stackexchange.com/q/118839/8546) – Graham Perrin Jan 27 '14 at 07:12
1 Answers
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). 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.
Old Pro
- 2,348
- 1
- 17
- 26
Michael Galati
- 436
- 4
- 2
-
5Note that, to get it back you can use: sudo nvram boot-args="vm_compressor=4" – James Antill Apr 25 '14 at 01:29
-
1I'd assume that `sudo nvram -d boot-args` would also revert it to its default. – Feuermurmel Apr 26 '15 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. – gojomo Aug 06 '15 at 02: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
-
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 C Oct 25 '15 at 16:18
-
Thankyou @RaduC! I had the same problem - changed to no compression, was trying to apply Yosemite minor update 10.11.2 and it would crash on shutdown. Logging out first made it possible to shutdown properly. – nevster Dec 14 '15 at 13:17
-
Note this no longer works on sierra: nvram: Error setting variable - 'boot-args': (iokit/common) general error – user3544438 Nov 22 '16 at 13:38
-
for sierra, disable system integrity protection first, it worked OK for me on sierra thusly – rogerdpack Dec 22 '16 at 20:02