The Memory and CPU settings were removed for WSL2 integration. However, starting in Windows Build 18945, there is a workaround to limit WSL2 memory usage.
Create a %UserProfile%\.wslconfig file for configuring WSL2 settings:
[wsl2]
memory=6GB # Any size you feel like (must be an integer!)
swap=0
localhostForwarding=true
Run Get-Service LxssManager | Restart-Service in an admin Powershell (or reboot) and verify that the vmmem usage in Task Manager drops off.
For the complete list of settings, please visit Advanced settings configuration in WSL.