Do not buy RAM, compress!
AI has changed a lot. We do more work in parallel. This increases the memory demand on our workstations.
Also, memory is expensive and often not extendable. So buying more RAM is not an easy option.
Recently I was running out of memory, I found my solution in zram
, a solution to compress memory.
Memory compression is not new. If you have a Windows or Mac device you are already using it. Also, many Android smartphones utilize the technique of using compression to put more data into the RAM. Unfortunately not all Linux environments have RAM compression enabled by default. Fedora, Pop!_OS do, but Ubuntu doesn’t. Amazon Linux only enables zram on smaller virtual machines. Most other distributions do not have it enabled.
Compressing memory does not come with downsides. It takes a little bit more from your CPU and adds latency to some processes. However, what you gain is gigantic amounts of extra capacity. It is not uncommon to see compression ratios up to 1:4.
I remember that in the early days of…