How do you empty you swap memory on Redhat or Fedora Linux

If you want to clear out your swap you can use the following commands.

#free

              total        used        free      shared  buff/cache   available
Mem:       16266516     5208028     8793132       96412     2265356    10509976
Swap:       8269820           10000    8259820


Then we use this command to disable swap:
$ swapoff -a

 
You can confirm that it's now empty: 
 
#free

              total        used        free      shared  buff/cache   available
Mem:       16266516     5208028     8793132       96412     2265356    10509976
Swap:       8269820                  0      8269820
 

we  re-enable our swap:
#swapon -a

Comments

Popular posts from this blog

How to clean all the foreman task and locked task

How to restrict users to send only mail to the local domain in Zimbra

Hardening Script