upvote
macOS also uses compression in the virtual memory layer.

(It's fun to note that I try to type out "virtual memory" in this thread, because I don't want people to think I talk about virtual machines.)

reply
One interesting thing with zram (which OS X also does by default) is that certain memory leaks... effectively don't. I have a little raspberry pi where I have zram enabled. If I make a string in python and keep appending 'a's to it, eventually zram just soaks it up:

  $ zramctl
  NAME       ALGORITHM DISKSIZE  DATA COMPR TOTAL STREAMS MOUNTPOINT
  /dev/zram0 zstd          3.8G  2.3G 13.2M 17.2M       4 [SWAP]
2.3GB of 'a's that gets compressed down to 20MB.
reply