dotfiles/scripts/wsl-free-mem.sh

7 lines
291 B
Bash
Executable File

# WSL2 Linux Module to free up caches and compact memory
# See Microsoft Blog (https://devblogs.microsoft.com/commandline/memory-reclaim-in-the-windows-subsystem-for-linux-2/)
# needs to run as root (sudo doesn't work)
echo 1 > /proc/sys/vm/drop_caches
echo 1 > /proc/sys/vm/compact_memory