Discussion:
Unable to use compressed swap, 10.9.5
Michael
2018-07-17 16:30:42 UTC
Permalink
I'd like some help figuring this out. My machine cannot use compressed swap in 10.9.5.

This is not an "always" issue. Originally it did use compressed swap with no problem. I switched to non-compressed swap because, under heavy load, the system would only have 6 GB for normal use, and 10 GB was used for the compressed data. And at the time, my normal heavy load was a minecraft server, a minecraft client, a teamspeak/skype call, and a video recorder -- which did not fit into 6 GB.

If I boot up a 10.12.6 image, I get compressed swap working just fine. But it takes too long to boot off my USB stick, and (bleep bleep apple) I don't have the room on my spare OS partition for the ever increasing OS size. (Bleep, why Apple, why do you force every important folder to be on the root partition? I've got tons of space on a giant partition on the internal drive, and I was brought up with a Multi-boot/Linux-based philosophy of the root partition is the stable system code, not /tmp, not swap, not users, not caches, etc.)

Symptoms: As soon as the swap data tries to go to disk, I see this in the console log:

Jul 16 22:55:30 keybounceMBP kernel[0]: low swap: suspending pid 11512 (Dragon Dictate)
Jul 16 22:55:30 keybounceMBP kernel[0]: low swap: suspending pid 2415 (firefox)
Jul 16 22:55:30 keybounceMBP kernel[0]: memorystatus_thread: idle exiting pid 90 [wdhelper]
Jul 16 22:55:30 keybounceMBP kernel[0]: (default pager): [KERNEL]: Swap File Error.

Dynamic Pager is being run with the default args:

118 ?? Ss 0:00.14 /sbin/dynamic_pager -F /private/var/vm/swapfile

And there are standby files there:

keybounceMBP:~ michael$ ls /private/var/vm/
total 1114112
65536 swapfile0 1048576 swapfile1
keybounceMBP:~ michael$

And, just in case:

keybounceMBP:~ michael$ openssl sha1 /sbin/dynamic_pager
SHA1(/sbin/dynamic_pager)= f6b342d0023745ad8088650a502cb7a4e87b12c0
keybounceMBP:~ michael$

Did perhaps the pager get disk corruption?

---
Entertaining minecraft videos
http://YouTube.com/keybounce
Michael
2018-07-21 02:08:50 UTC
Permalink
Post by Michael
I'd like some help figuring this out. My machine cannot use compressed swap in 10.9.5.
This is not an "always" issue. Originally it did use compressed swap with no problem.
So I found the first issue, and I don't understand it. I'm looking for more help.

I had, probably by mistake, configured a boot plist at /Library/Preferences/SystemConfiguration. I thought that the values I specified in the boot-args nvram setting were running things, but no, that file was overriding anything I was trying to specify on the boot-args.

So that's issue number one. I can make compressed swap "work" by removing this line:
<string>vm_compression_limit=1048576</string>

But that's the problem. The default action is to use 10 GB of my 16 GB for compressed swap. That's too much.

The vm compressor code is located at https://opensource.apple.com/source/xnu/xnu-2422.1.72/osfmk/vm/vm_compressor.c.auto.html
Reading it (and it was in my browser history, as well as a question I asked on stack overflow), the vm_compression_limit seems to go into a maximum number of compressed pages limit.

The number in the config file is 1024 * 1024, which seems to be a reasonable number of pages (1m pages, 4K per page, is 4 GB.) Yet it causes a swap error as soon as the limit is reached, and I'm prompted to close an unwanted app because the system is "out of application memory".

So I've got two choices, and I'm looking for the third:
1. No compression -- system works, but swap fills up rather quickly.
2. Compression, default -- system "works", but I don't have enough live memory.
3. What I want -- compression with less memory used by the compressor.

Can anyone help with this?

Loading...