| ▲ | antongribok 3 hours ago | |
I think more people should know about the existence of ZRAM on modern Linux distributions. It's really changed the way I look at swap configs. ZRAM is a compressed block device that is stored in RAM. It's great! Previously, if I ever had high memory pressure situations, I really dreaded the slowdowns. Now, with swap sitting on top of /dev/zram0 it's a completely different experience. I have ZRAM enabled on all of my personal machines, both laptops with limited memory, and desktops with 64 or 128GB of RAM. It's rarely used, but it is nice to have that extra room sometimes. The performance of a zram device is so much faster than even the latest NVMe drives. | ||
| ▲ | anyfoo 3 hours ago | parent | next [-] | |
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.) | ||
| ▲ | justinsaccount 3 hours ago | parent | prev [-] | |
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:
2.3GB of 'a's that gets compressed down to 20MB. | ||