Posted by: Odzangba | October 12, 2009

How To Disable Compcache (and Fix Swap Errors) in Ubuntu 9.04

For weeks now my Jaunty box would lock up unexpectedly and only a hard reset could bring it back to life. Since it did not happen often, I just brushed it off… to be completely honest, I was too lazy to track down the problem. 😀 But my box locked up again a few minutes ago as I was waiting on a very important download and after I’d exhausted my vocabulary of swear words (and seriously contemplated throwing my monitor through the window), I decided I’d had enough. I examined my logs and noticed these errors around the time the lock-up kicked in:

compcache: Error allocating memory for compressed page: 37691, size=28
compcache: Error allocating memory for compressed page: 126848, size=233
compcache: Error allocating memory for compressed page: 106315, size=40

So I googled compcache and found out that it wasn’t supposed to be active on permanent installations like mine. Basically, it helps computers with low RAM to comfortably load a livecd session through a fairly boring use of “virtual RAM.” The important thing is, it should only kick in during a livecd session. It’s also quite unstable.  Read more about compcache here.

To find out if compcache is active on your system, do:

sudo swapon -s

If you see /dev/ramzswap, compcache is plotting to lock up your box when you least expect it. To permanently disable compcache, do:

sudo rm -f /usr/share/initramfs-tools/conf.d/compcache && sudo update-initramfs -u

Then either reboot or do a

sudo swapoff /dev/ramzswap{insert the device number here}… so for example:

sudo swapoff /dev/ramzswap1

The morale of the story is, don’t be lazy… it took me about three minutes to track down the problem, fix it and get on with my life. 🙂 Now I have to restart this 700MB download. 😦


  1. have you started using “wget -c” for your big downloads? particularly Linux iso files. doing so should reduce the temptation to throw your monitor out the window after a lock up..

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


%d bloggers like this: