Posts

Showing posts from January, 2017

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

How do you empty the buffers and cache memory on Redhat or Fedora Linux

Emptying the buffers cache We can signal the Linux Kernel to drop various aspects of cached items by changing the numeric argument to the above command. To free pagecache: # echo 1 > /proc/sys/vm/drop_caches To free dentries and inodes: # echo 2 > /proc/sys/vm/drop_caches To free pagecache, dentries and inodes: # echo 3 > /proc/sys/vm/drop_caches      If you ever want to empty it you can use this chain of commands.   [root@localhost]#free && sync && echo 1 > /proc/sys/vm/drop_caches && free total used free shared buff/cache available Mem: 16266516 5208028 8793132 96412 2265356 10509976 Swap: 8269820 0 8269820 total used free shared buff/cache available Mem: 16266516 5209212 10645992 96412 411312 10582088 Swap: 8269820 0 8269820