Skip to content

Instantly share code, notes, and snippets.

@wernersmit
Created June 8, 2014 07:36
Show Gist options
  • Save wernersmit/0ffb684af4363385c370 to your computer and use it in GitHub Desktop.
Save wernersmit/0ffb684af4363385c370 to your computer and use it in GitHub Desktop.
Free memory on a running Linux system without rebooting
###########################################################
# Free memory on a running Linux system without rebooting #
###########################################################
#!/bin/sh
# sh -c "sync; echo 3 > /proc/sys/vm/drop_caches"
# Flush file system buffers by executing
sync;
# free page cache
echo 1 > /proc/sys/vm/drop_caches;
# free dentries and inodes
echo 2 > /proc/sys/vm/drop_caches
# free page cache, dentries and inodes
echo 3 > /proc/sys/vm/drop_caches
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment