How do you limit memory usage of WSL?
Experience Level: Junior
Tags: WSL
Answer
If the file doesn't exist yet, create the file .wslconfig in your user profile root folder.
Add the following section:
[wsl2]
memory=1GB # Limits VM memory in WSL 2 up to 1GB
Related WSL job interview questions
How can you display you current Linux folder in Windows File Explorer?
WSL JuniorHow can you access WSL from Windows?
WSL JuniorWhat is a file .wslconfig good for?
WSL JuniorHow do you re-run WSL that you stopped before?
WSL JuniorHow do you shutdown WSL?
WSL Junior