Last active
July 1, 2019 12:11
-
-
Save 1901/b0d5376c7c7726ee258d6ad4f96fcf4a to your computer and use it in GitHub Desktop.
[linux_clear_memory_cache] #linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 1. Clear PageCache only. | |
| sync; echo 1 > /proc/sys/vm/drop_caches | |
| # 2. Clear dentries and inodes. | |
| sync; echo 2 > /proc/sys/vm/drop_caches | |
| # 3. Clear PageCache, dentries and inodes. | |
| sync; echo 3 > /proc/sys/vm/drop_caches | |
| # If you want to clear Swap space, you may like to run the below command. | |
| swapoff -a && swapon -a | |
| # ref: https://www.tecmint.com/clear-ram-memory-cache-buffer-and-swap-space-on-linux/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment