Question regarding RAM compression (zram)

Hi Rosika,
I dont know, but I can guess
If you turn off your swapfile (or unmount a swap partition for that matter) it would be

  • ok if the Linux had not swapped any pages out onto the swap space
  • you might lose pages if there were some pages swapped out, and you cleared the swapfile
  • if it was in the act of swapping when you cleared the swapfile, there might be corruption of pages
  • if zswap were running, i think the same would apply, only it would be hopefully less likely to be swapping

So I would be careful doing that swapoff. Make sure that linux is idle ( ie not swapping) when you do swapoff. It may be clever enough to clear any activity before doing the swapoff, or it may just cut you off.

Regards
Neville

1 Like

Thanks @nevj for providing your views on the matter. :heart:

I see. Well, the conseqeunces of my hypothetical scenario hopefully wouldnĀ“t be overly dramatic (except for losing pages / corruption of pages) but IĀ“d certainly like to avoid that anyway.:wink:

I guess avoiding swapoff would be the wisest action by far.

On ubuntuusers it says:

Swap is unused after the system has started.

If you want to empty the swap during operation, the swap must first be deactivated and then activated again.

If swap is entered in /etc/fstab, the commands for this are as follows:

sudo swapoff -a  ## Swap off
sudo swapon -a   ## Swap on

(translated from German)

They donĀ“t give any reason for wanting to do that.

Well, I guess everything (or most of it is clear now) . :wink:

Thanks a lot for your help, Neville.

Have a nice Sunday and many greetings.
Rosika :slightly_smiling_face:

1 Like