Disabling compcache in Ubuntu Jaunty (and Related Swap Errors)

If you have installed Ubuntu recently, you may have compcache enabled. This is a memory-based swap cache and its presence is unnecessary and unexpected in a permanent installation (it was designed for LiveCD operations). There is a bug report about compcache being enabled, along with directions on how to remove it.

This bug can also be seen if you are seeing errors like these:

Mar 6 17:27:29 server kernel: [14438.135859] compcache: Error allocating memory for compressed page: 60594, size=4096
Mar 6 17:27:29 server kernel: [14438.135871] Write-error on swap-device (254:0:484752)
Mar 6 17:27:29 server kernel: [14438.136813] allocation failed: out of vmalloc space - use vmalloc= to increase size.
Mar 6 17:27:29 server kernel: [14438.136824] compcache: Error allocating memory for compressed page: 60595, size=2093
Mar 6 17:27:29 server kernel: [14438.136835] Write-error on swap-device (254:0:484760)
Mar 6 17:27:29 server kernel: [14438.137088] allocation failed: out of vmalloc space - use vmalloc= to increase size.
Mar 6 17:27:29 server kernel: [14438.137098] compcache: Error allocating memory for compressed page: 60596, size=4079
Mar 6 17:27:29 server kernel: [14438.137108] Write-error on swap-device (254:0:484768)

You can also see it when you print swap information with the command swapon -s – if compcache is enabled, one of the swap entries will be “ramzswap”.

To disable compcache completely, do this:

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

The file compcache contains this line – which is what enables (and sizes) compcache:

COMPCACHE_SIZE="25%"

This was summarized nicely in this email on the ubuntu-users mailing list in February of this year.

3 thoughts on “Disabling compcache in Ubuntu Jaunty (and Related Swap Errors)”

  1. This is (very) old news, and based on Compcache 0.4 which is obsolete. Version 0.6 has been out for a while now and works just fine. Actually, compcache will be part of the mainline kernel as of 2.6.33.

    1. My experience to date is that problems that come up in Ubuntu (and possibly other distributions) are often relegated to the dust-bin if there is a fix or a new version. The fact that this problem remains in Jaunty and perhaps other Ubuntu versions that continue to have updates is a problem.

      This problem is not unique; the problems with wifi drivers continually reconnecting because of a driver bug, and problems with Keyspan serial adapters and firmware have not yet been fixed for Jaunty – and wont be.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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: