Last active
August 11, 2020 22:15
-
-
Save denji/70bb26b91fe816ce10a41858240f2115 to your computer and use it in GitHub Desktop.
fincore [options] files... Flush Linux pagecache, dentrie & inode (cache) + reswaping 0B
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
#!/usr/bin/sh | |
# Flush Linux pagecache, dentrie & inode (cache) | |
# Reswaping 0B | |
MIN_MEMORY=78643200 # Reswap only if there is free RAM (75MB) | |
#PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin | |
#PATH=/bin:/sbin:$PATH | |
# Flush pagecache + reswaping 0B: | |
(sync && echo 1 > /proc/sys/vm/drop_caches; if [ "`grep MemFree /proc/meminfo | grep -Eo '[0-9]+'`" -gt "$MIN_MEMORY" ]; then (swapoff -a && swapon -a); fi) | |
# Flush dentrie и inode (cache) + reswaping 0B: | |
# (sync && echo 2 > /proc/sys/vm/drop_caches; if [ "`grep MemFree /proc/meminfo | grep -Eo '[0-9]+'`" -gt "$MIN_MEMORY" ]; then (swapoff -a && swapon -a); fi) | |
# Flush pagecache, dentrie & inode (cache) + reswaping 0B: | |
# (sync && echo 3 > /proc/sys/vm/drop_caches; if [ "`grep MemFree /proc/meminfo | grep -Eo '[0-9]+'`" -gt "$MIN_MEMORY" ]; then (swapoff -a && swapon -a); fi) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment