💾 Archived View for danieljanus.pl › blog › en › 2008 › 04 › 25 › best-os-ever › index.gmi captured on 2023-01-29 at 16:00:11. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2021-11-30)
-=-=-=-=-=-=-
If you are reading this on a box that does not have an impressive amount of RAM (say, 512 MB or less) and is running a fairly recent Linux, then for goodness sake, drop everything you are doing right now and follow the instructions in this entry. I’m going to show you how to make your system use the memory in a more efficient way, yielding an effect almost equivalent to increasing its amount — with no expenses whatsoever! Sounds good? Read on.
You see, there’s this Linux kernel module for kernels 2.6.17 and up (that’s what the phrase fairly recent in the previous paragraph macroexpands to), called Compcache [1]. It works by slicing out a contiguous chunk of your RAM (25% by default, but it’s settable, of course) and setting it up as a swap space with highmost priority. The trick is that pages that are swapped out to this area are compressed using the LZO [2] algorithm, which provides very fast compression/decompression while maintaining a decent compression ratio. In this way, more unused pages can fit in memory, and less of them are swapped out to disk, which can considerably cut down disk swap usage. I’ve enabled it in my system and it doesn’t seem to cause any problems, while providing a visible efficiency boost. Here’s how I did it on a freshly-installed Ubuntu Hardy [3]:
case "$1" in
start)
/usr/local/bin/use_compcache.sh ;;
stop)
/usr/local/bin/unuse_compcache.sh ;;
esac
I then rebooted the system and verified that the new swapspace is in use:
nathell@chamsin:~$ cat /proc/swaps Filename Type Size Used Priority /dev/sdb2 partition 996020 0 -1 /dev/ramzswap0 partition 128896 111396 100
With the final release of Hardy installed on my main box and compcache optimizing its memory usage, I do not hesitate to call this combo the best OS I have ever had installed.
And no, I don’t own a Mac. :-/