Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Running Ubuntu 12.10 here, on an 128Gb SSD and a 4GB RAM system. Ever since I installed the OS, I realised that I dont need the swap partition, as I never use the hibernate function and rarely run out of RAM. However, would installing zRam bring any real improvement when RAM is full, even if there is no swap partition?

share|improve this question
Using zRAM On Ubuntu 13.04 Linux – Qasim May 21 '13 at 1:44
up vote 6 down vote accepted

I would presume whether or not you have swap space is more or less irrelevant to the usefulness of zRam. Regardless of whether or not you have zRam installed, if you run out of RAM with no swap space, bad things start to happen. :-)

If you do expect to run out of RAM, then zRAM could be helpful because it essentially expands the amount of data you can store in RAM (assuming it's not of unreasonably high entropy) so it will take longer to fill up. So it might buy you some more time, assuming you're not storing large arrays of random numbers.

If you're 99.9% sure you won't get close to running out of RAM (i.e. you have 16GB on your web-only netbook), than anything stored in zRAM is needlessly requiring extra CPU time to compress and decompress, so it's not really beneficial in this case.

If you're on the high end of the RAM usage spectrum (on average over 50-60%, for example) you might benefit from some additional peace of mind using zRAM. (Or you could buy more RAM.)

I suppose you have to evaluate your normal and heavily-loaded RAM utilization (average and max) and what kind of data you work with.

share|improve this answer

Yes enabling zRAM is certainly a best thing.why means zRAM will creates a RAM based block device which acts as a swap disk, but is compressed and stored in memory instead of swap disk allowing very fast I/O and increasing the amount of memory available before the system starts swapping to disk.

Actually compcache is the original name and its changed to zRAM these days.

you can install it with sudo apt-get install zram-config

share|improve this answer

It is NOT true that disabling swap is bad. Because if you running out of memory without swap OOM will be invoked and some of tasks just die, you can continue your work. In case with swap it's very easy to run out of memory + out of swap, in this case your machine will hang in disk IO. Most probably reasons you run out of memory (memory leak, huge allocation) - it wouldn't stop on RAM size, it will eat whole swap too and you will run out of memory anyway.

You could easily try this with simple program which allocates memory in infinity loop with and without swap.

share|improve this answer

zRAM will only get used if it's needed, so enabling it will have no effect if you don't need it. I very much doubt you will even notice it working when it is needed.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.