Condition: to activate zswap module in Ubuntu 16.04 successfully for Matlab/.... computation
Relevant part in /etc/default/grub

zswap.enabled=1              # NB only change here 
                             # NB also tried to have the line here unsuccessfully    

I try to activate zswap and run sudo update-grub

Searching for GRUB installation directory ... found: /boot/grub
/etc/default/grub: line 12: zswap.enabled=1: command not found

I also tried the code where zswap line is after GRUB_CMDLINE_LINUX="" unsuccessfully.

My current setting after heynnema's answer

  • Have the following in /etc/default/grub, which works unspecifically; dmesg | grep zswaps returns something

    # https://wiki.archlinux.org/index.php/Zswap
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash zswap.enabled=1 zswap.max_pool_percent=25 zswap.compressor=lzo"
  • Run sudo update-grub.

Its effect on the maximum Ram?

There are some threads about it is saving some pages in the pool, etc zswap: How to determine whether it is compressing swap pages? However, there is no studies about its effect on the maximum Ram for the computaion.

System: Linux Ubuntu 16.04 64 bit Linux kernel: 4.6
Linux kernel options: wl
Matlab: 2016a
Hardware: Macbook Air 2013-mid
Related threads: How can I enable zswap?, Zswap Arch Linux, zswap: How to determine whether it is compressing swap pages?

1 Answer 1


You put your zswap.enabled in the wrong place.

Change this:


To this:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash zswap.enabled=1"

then sudo update-grub and reboot.

If it doesn't work, it may not be available/compatible with 16.04.

  • How can you show that this activates zswap? The command lsmod | grep zswap gives blank. Command swapon also does not show anything about zswap. Commented Jul 25, 2016 at 18:40
  • Command dmesg | grep zswap gives [ 2.867664] zswap: loaded using pool lzo/zbud once. However, it does not tell me what is the effect of zswap. Can you evaluate its effect better? Commented Jul 25, 2016 at 19:04
  • Google "zswap" to understand more about how it works. I just wanted to tell you how to enable it correctly. I've never used it. Cheers, Al
    – heynnema
    Commented Jul 25, 2016 at 20:38
  • @Masi this page on zswap is excellent wiki.archlinux.org/index.php/Zswap
    – Alex Jones
    Commented Jul 28, 2016 at 12:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .