Skip to content

How to Clear Swap on CentOS

  • by
Switching SWAP on and off can release and clear the space.
  1. Check SWAP space before bouncing.
  2. [root@localhost ~]# free
                 total       used       free     shared    buffers     cached
    ...
    Swap:      1048568       5960    1042608

  3. Disable and enable SWAP.
  4. [root@localhost ~]# swapoff -a; swapon -a
  5. Check SWAP space after bouncing.
  6. [root@localhost ~]# free
                 total       used       free     shared    buffers     cached
    ...
    Swap:      1048568          0    1048568
You can see SWAP is refreshed.

Leave a Reply

Your email address will not be published.