You can create a file called .wslconfig to restrict the resources used by wsl2 (windows linux subsystem). Follow the steps below to create it: