Clear swap in Centos

Print memory usage

[root@localhost]# free -m
             total       used       free     shared    buffers     cached
Mem:         15658      11521       4137          0         17       4398
-/+ buffers/cache:       7105       8553
Swap:         4095       3995        100

Clear swap (may take a time)

[root@localhost]# swapoff -a && swapon -a

Memory usage after swap clearing

[root@localhost]# free -m
             total       used       free     shared    buffers     cached
Mem:         15658      15490        168          0         21       4437
-/+ buffers/cache:      11030       4627
Swap:         4095          4       4091

 

Was this answer helpful?

 Print this Article

Also Read

Security tips for Linux server

1. Use only  strong passwords for all accounts , especially for root. Always use a secure root...

Changing ssh port

How to change ssh port. Open the file /etc/ssh/sshd_config with your favourite text...

Web server

In this guide we will create our own web server on Centos 6.  We will use Apache...

Disabling selinux

Selinux annoying you? Get it out! How to disable selinux Open its config file nano...

nginx

How to install nginx on Centos Add nginx repo first. To add it, create the file...