From a41c659662519014a6147e24ab94e3ae286065c0 Mon Sep 17 00:00:00 2001 From: kneutron <50146127+kneutron@users.noreply.github.com> Date: Mon, 12 Apr 2021 14:45:41 -0500 Subject: [PATCH] Add files via upload --- ZFS/clearcache.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 ZFS/clearcache.sh diff --git a/ZFS/clearcache.sh b/ZFS/clearcache.sh new file mode 100644 index 0000000..f5ac9cb --- /dev/null +++ b/ZFS/clearcache.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# free up cache RAM +# http://linux-mm.org/Drop_Caches + +free +time sync + +echo 1 > /proc/sys/vm/drop_caches # free pagecache +free + +#To free dentries and inodes: +[ "$*" = "2" ] && echo 2 > /proc/sys/vm/drop_caches + +#To free pagecache, dentries and inodes: +[ "$*" = "3" ] && echo 3 > /proc/sys/vm/drop_caches +#echo 3 > /proc/sys/vm/drop_caches