You're confusing the boot argument vm_compressor
with the sysctl variable vm.compressor_mode
; they don't correspond in values. As I understand it, this is the mapping:
nvram boot-args="" => sysctl vm.compressor_mode=4 => memory compression enabled (normal)
nvram boot-args="vm_compressor=1" => sysctl vm.compressor_mode=1 => memory compression disabled
To restore the default behavior, either:
- remove the one boot argument from NVRAM; or
- remove all boot arguments,
sudo nvram -d boot-args
– then restart the Mac.
Analyzing the ETL file with WPA shows, that the CPU usage doesn't come from system memory compression. It comes from ntoskrnl.exe!MiScrubMemoryWorker
:
Line #, DPC/ISR, Process, Stack Tag, Stack, Count, TimeStamp (s), % Weight
8, , , , | | |- ntoskrnl.exe!MiScrubMemoryWorker, 79667, , 12,45
9, , , , | | | ntoskrnl.exe!MiScrubNode, 79667, , 12,45
10, , , , | | | ntoskrnl.exe!MiScrubNodeLargePages, 79667, , 12,45
11, , , , | | | ntoskrnl.exe!MiScrubNodeLargePageList, 79667, , 12,45
12, , , , | | | |- ntoskrnl.exe!MiScrubPage, 79663, , 12,45
13, , , , | | | | |- ntoskrnl.exe!RtlScrubMemory, 79653, , 12,45
14, , , , | | | | | |- ntoskrnl.exe!RtlpGenericRandomPatternWorker, 38549, , 6,02
This is a function to test the memory for errors by filling / reading some patterns (ntoskrnl.exe!RtlpGenericRandomPatternWorker
).
This is by design and happens when the idle maintenance task kicks up when your device is idle.
Best 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:
Then reboot. You can verify the change was successful by running:
Starting with macOS 10.12 Sierra, the old VM_PAGER_DEFAULT is no longer supported and
vm_compressor=1
is converted tovm_compressor=4
inside the kernel.