dotfiles/scripts/wsl-free-mem.sh
2023-07-23 19:28:30 +02:00

7 lines
291 B
Bash

# 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