Skip to content

Instantly share code, notes, and snippets.

@Tester2009
Created April 3, 2017 12:32
Show Gist options
  • Save Tester2009/0d7b12bd8524c007d517582a18a245cd to your computer and use it in GitHub Desktop.
Save Tester2009/0d7b12bd8524c007d517582a18a245cd to your computer and use it in GitHub Desktop.
Free RAM and Swap
# source: http://www.tecmint.com/clear-ram-memory-cache-buffer-and-swap-space-on-linux/
# Clear PageCache, dentries, and inodes
# Sync will flush the filesystem buffer.
# Chmod this file to 755
sync; echo 3 > /proc/sys/vm/drop_caches
echo "Syncing..."
# Clear Swap Space
swapoff -a && swapon -a
echo "RAM Cache and Swap cleared"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment