There is an ongoing issue with vmmem eating up all your memory in windows 10 2004. There is a workaround.
Workaround: Create a
Apostolos%UserProfile%\.wslconfig
file in Windows and use it to limit memory assigned to WSL2 VM.
https://github.com/microsoft/WSL/issues/4166#issuecomment-526725261
Below is an example of .wslconfig
[wsl2]
memory=6GB
swap=0
localhostForwarding=true