Skip to content

Instantly share code, notes, and snippets.

@asaelko
Created July 6, 2015 22:25
Show Gist options
  • Save asaelko/0ad7d89816923266f6dd to your computer and use it in GitHub Desktop.
Save asaelko/0ad7d89816923266f6dd to your computer and use it in GitHub Desktop.
Free memory
#!/bin/sh
echo "Было занято в кеше ОЗУ"
free
# Чистим pagecache:
sync
echo 1 | sudo tee -a /proc/sys/vm/drop_caches
#Чистим dentrie и inode кэши:
sync
echo 2 | sudo tee -a /proc/sys/vm/drop_caches
#Чистим pagecache, dentrie и inode кэши:
sync
echo 3 | sudo tee -a /proc/sys/vm/drop_caches
echo "Стало свободно в ОЗУ"
free
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment