by izwasm on 2/6/23, 5:48 PM with 13 comments
by nikau on 2/7/23, 1:53 PM
By design it will end up using all the allocated ram for caches and linux programs.
If you really need to free ram for windows apps you can flush caches by running below as root
echo 1 >> /proc/sys/vm/drop_caches
by pxc on 2/6/23, 6:00 PM
I really wish I could just run proper Linux on the metal. Docker under emulation is such a disaster! I don't understand how it's the norm.
by NGRhodes on 2/7/23, 6:06 PM
As far as I know, the high memory usage of WSL2 is due Linux using as much spare RAM as possible for caching and WSL2 having to allocate memory for this cache. Both Linux and Windows memory ballooning under KVM/QEMU manages dynamically manage memory and work around memory caching.
I suspect the issue with WSL2 allocated memory being quickly consumed by cache could be currently a limitation of the Hyper-V hypervisor or the WSL2 kernel.
by kristianp on 2/6/23, 11:50 PM
by Allyedge on 2/8/23, 11:00 PM
I just set it to 12 GB max, since I have 32 GBs of RAM, and it works just great.