User Tools

Site Tools


swap:clear_swap

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

swap:clear_swap [2017/04/03 15:43] – created peterswap:clear_swap [2019/12/04 21:41] (current) – removed peter
Line 1: Line 1:
-====== Swap - Clear swap ====== 
- 
-Check your swap usage: 
- 
-<code bash> 
-free -m 
- 
-                    total       used       free     shared    buffers     cached 
- 
-Mem:          1024        157        866          0         11         48 
- 
--/+ buffers/cache:         97        926 
- 
-Swap:          127         95         32 
-</code> 
- 
-where  
- 
-  * **-m** is for the value to be listed in megabytes. 
- 
- 
-To clear the swap: 
- 
-<code bash> 
-sync && /sbin/sysctl vm.drop_caches=3 && swapoff -a && swapon -a  
-</code> 
- 
-where  
- 
-  * **sync** is to force changed blocks to disk and update the super block;  
-  * **sysctl vm.drop_caches=3** is to free pagecache, dentries and inodes;  
-  * **swapoff** is to turn off swap; 
-  * **swapon** is to turn swap back on. 
- 
- 
-Check the swap again: 
- 
-<code bash> 
-free -m 
- 
-                    total       used       free     shared    buffers     cached 
- 
-Mem:          1024        157        866          0         11         48 
- 
--/+ buffers/cache:         97        926 
- 
-Swap:          127                 127 
-</code> 
  
swap/clear_swap.1491234196.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki