Created
June 8, 2014 07:36
-
-
Save wernersmit/0ffb684af4363385c370 to your computer and use it in GitHub Desktop.
Free memory on a running Linux system without rebooting
This file contains 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
########################################################### | |
# 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