2

I've already ran

sudo nvram boot-args="vm_compressor=2"

and this is the response from sysctl

sysctl -a vm.compressor_mode

vm.compressor_mode: 2

The problem is Activity Monitor still reports that swap is used. Activity Monitor Screenshot

I want to know if anyone has a way to get the system to honor the compressor mode as set in Catalina.

I've read through Can I turn off swap and/or memory compression on macOS 10.12, Sierra? and I know well meaning people have explained the reasons why we shouldn't turn off the swap. I still want to do it anyway.

  • 1
    Out of curiosity, why do you want to turn it off? So you won't trash your hard drives? – RTHarston May 22 '20 at 03:53
  • 1
    @RTHarston yes! That's the main reason. The secondary reason is RAM is always faster SSD. The less the system has to drag things out of swap, the better. – ionStorm May 23 '20 at 05:11
  • Oops, I meant thrash, not trash. ;) No offense, but what makes you think you know better than the designers of the OS? Modern macOS is built on the concept of having Swap available, if it isn't then things will probably run worse than better. Yes, RAM is always faster than the SSD, and the OS developers know that. They aren't going to swap out RAM willy-nilly for no reason. If you turn swap off there is a chance something will run out of memory and simply crash. Not sure how that is a better alternative. ;) If you figure out how to turn it off I am curious how things go. – RTHarston May 26 '20 at 17:06
  • Also, they are aware of the write limits of SSD. I'm sure they are careful not to swap out to SSD more than necessary. And in the days of HDD swapping things out of RAM was extremely slow, so it probably avoids it on HDD as well. All things considered, the system is probably optimized to avoid swap if it can. Which is actually what the compression thing is all about; compressing and decompressing RAM, when it can, is much faster than swapping to the drive. So again, I imagine the system avoids swapping out to the drive unless necessary. – RTHarston May 26 '20 at 17:18
  • And Swap only thrashes the drive when you are running out of RAM and switching between applications, and that is exactly when you'd also be most likely to see something simply crash if you turn swap off. So if you turn off swap you'd want to use less RAM to avoid things crashing, but if you are purposefully using less RAM to avoid crashing you could just use less RAM to reduce swap. So I don't see much reason to turn it off unless you are in for the learning experience, which to be honest I think is reason enough. ;) Just don't forget applications expect swap these days and might not behave. – RTHarston May 26 '20 at 17:21
  • 1
    No offense, but what makes you think you know better than the designers of the OS? I may not know the OS better, but I do know is that writes are finite. That is the basis of my action.

    If you turn swap off there is a chance something will run out of memory and simply crash. I've ran Windows without swap for many years with no issues. I have not had a random unexplained crash for many years either. While it doesn't mean macOS is the same, I'm willing to try the same on macOS and if it crashes and i'll know it's not a viable option.

    – ionStorm May 27 '20 at 02:15
  • 1
    If you turn swap off there is a chance something will run out of memory and simply crash. I've ran Windows without swap for many years with no issues. I have not had a random unexplained crash for many years either. I'm willing to try the same on macOS. If it crashes and i'll know it's not a viable option. ---

    Also, they are aware of the write limits of SSD. It doesn't matter whether they are aware because their goals and mine are different. Their aim, I presume, is to do the best within "reasonable" limits. Mine is maximum lifespan.

    – ionStorm May 27 '20 at 02:16
  • 1
    but if you are purposefully using less RAM to avoid crashing you could just use less RAM to reduce swap I've tried this but the threshold for my machine seems to be 8GB or 50%. I believe the other person who wanted to do this had 32GB and his started swapping well before 50%. – ionStorm May 27 '20 at 02:16
  • SSDs lifespans are actually quite good. People tend to blow the actual numbers way out of proportion. That said, it is your drive so do what you feel is best for you and it. :) I wish I could help with the actual task, but I figured I'd at least help make sure you really knew what you were asking for. Looks like you do. XD As an aside, Windows might live without swap better than macOS since it is a pretty easy setting to find. If it is even possible in macOS to turn off swap it is probably an unsupported hack, and as such the OS might not like it as well as Windows. Again, I'm curious. ;) – RTHarston May 28 '20 at 00:33
  • "No offense, but what makes you think you know better than the designers of the OS?" LOL that's a darn offence. The guy is the owner of the computer, he can do as he pleases. – mariano-daniel Aug 14 '23 at 14:18
  • OP @RTHarston, did you ever manage to turn off Swap? I'm looking into doing it again, but forgot what command I used. When I had it off it only prevented Safari from opening, but because I usually have +100 tabs on. And I'm running on an old 2016 Macbook 12 inch with 8G and using very mem intensive programs. – mariano-daniel Aug 14 '23 at 14:19
  • 1
    @mariano-daniel, I did not. I was curious if the OP found out how, but I wasn’t looking to do it myself. – RTHarston Aug 31 '23 at 18:44

0 Answers0