initramfs-tools: ZRAM is not used in Live CD's if the machine has more than 512 MB RAM

Bug #1095154 reported by Mélodie
This bug affects 1 person
Affects Status Importance Assigned to Milestone
initramfs-tools (Ubuntu)
Won't Fix

Bug Description

The Ubuntu version used in Precise Pangolin;
The initramfs-tools version used is 0.99ubuntu13:

I am trying to make a customized Live CD with the ZRAM kernel module enabled in the Live. I found the files dedicated to configure it for the Live CD, but when I tried the resulting ISO in Virtualbox ZRAM was not activated. Then I discovered the file "$WORKDIR/initrd/scripts/init-top/compcache", and I found this section in the script:


# Do not use compcache on the liveCD if we have more than 512M
if [ "${BOOT}" = "casper" ]; then
    if [ "${TOTAL_RAM}" -gt 524288 ]; then
        exit 0


therefore I restarted Virtualbox with an amount of RAM less than 512M to see if this time ZRAM would be enabled and YES it was!

I think it is a pity to limit the amount of available RAM for a given machine where the Live will be used, because it can always be useful, and also because the ZRAM swap device will be used only if needed.

I would like this limitation to be removed.

The present bug report could be tagged "wish-list" or "low".

Thanks for considering this request.


Phillip Susi (psusi)
summary: - initramfs-tools: ZRAM is not used in Live CD's if the machine has less
+ initramfs-tools: ZRAM is not used in Live CD's if the machine has more
than 512 MB RAM
Revision history for this message
Steve Langasek (vorlon) wrote :

Hi Mélodie,

It's not true that "the ZRAM swap device will be used only if needed." The zram swap device must be pre-allocated, and (of course) takes away from system memory. If the total memory needed by the live system is less than the amount of physical ram, but more than ($physical_ram - $zram_size), enabling zram will result in a performance penalty for memory access because of the added overhead of compression.

So it's by design that we only enable zram in cases where we know we need more RAM than we have available, and when we know we won't have swap.

Changed in initramfs-tools (Ubuntu):
status: New → Won't Fix
Revision history for this message
Mélodie (meets) wrote :

Hi Steve,

In my experience a limit at 512 MB is too low anyhow.

If a limit needs to be fixed it should be at least 10024 MB and not less. About pre allocation : instead of giving the zram devices 50% of the total amount RAM provided by the hardware, 25% would be a good number, which is what the developer of the compcache project advised.
Here is the wiki,

here are benchmarks,

here on eeepc with Ubuntu, back in 2011:

(Ubuntu was using 25% of the available ram for the zram module).

I have put test versions of Ubuntu Precise remixes with compache enabled and not limited in them. I have installed the bigger (a version setup fully up to date, with Openbox and a panel of applications) to a T30 IBM Thinkpad having 512 MB RAM. The only annoyance I met with have been the kernel swapping while less than half of the physical memory was yet used, which I fixed by configuring swappiness in the sysctl.conf file (for this annoyance I don't know what should be done : seek for bug reports at maybe ?)

Could this bug report be reopened, and a request to raise the limit RAM considered ?


Revision history for this message
Mélodie (meets) wrote :

my finger ripped : I mean not "at least 10024 MB" but 1024 MB of course.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers