Created
December 11, 2018 14:47
-
-
Save Rockstar04/fed7a3a4cce1b3f0b04654f605469739 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
# This file will create a cronjob that flushes kernel caches | |
# This is intended for with in VMs that support memory ballooning | |
# and will allow the hypervisor to reclaim memory | |
cat << 'EOF' >> /etc/cron.hourly/shrink_mem | |
#!/usr/bin/env bash | |
sync | |
echo 3 > /proc/sys/vm/drop_caches | |
EOF | |
chmod +x /etc/cron.hourly/shrink_mem | |
/etc/cron.hourly/shrink_mem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment