2007 wants its page files back

compcache. Use it.

The general idea is to set apart some physical memory as swap space, with compression on the pages going in. Much of what’s in RAM is very compressible, so a fast compression algorithm can do a lot. I ran a large portion of a swap file through LZO and got a ratio above 3:1. And it was fast. I’ve never seen compression that fast. The bottom line is: compressing back to RAM is orders of magnitude faster than copying to disk, in more ways than one.

I enabled this feature on an old Pentium III laptop and it works wonderfully. I found it was already present in CrunchBang 9.04, an extremely light Ubuntu variant; I just had to set COMPCACHE_SIZEin an init script. That machine has 256M memory and a

So I tried it on my workstation with its 2 gig memory. With COMPCACHE_SIZE="30 %", if the compression ratio holds out, I’ve got more like 3.2 gig, and I’m pushing the limits of my primitive ape address space. A 64 bit machine could have, say, 8 gig RAM. A 50% compcache would be stellar: 4 gig of real RAM, and quick access to another 8 gig or more. There is definitely no need for the disk, and swapping is definitely a waste of SSD life.

To set it up in Ubuntu:

  • edit /etc/initramfs-tools/initramfs.conf
  • change COMPCACHE_SIZE
    (specific instructions are there in the file)
  • run update-initramfs -u
  • disable swap files in /etc/fstab
    (optional probably. I think compcache gets priority.)
  • reboot
This entry was posted in Uncategorized. Bookmark the permalink.