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

Comments

No Comments Yet.
Be the first to tell us what you think.
Windows Subsystem for Linux (WSL)
Windows Subsystem for Linux (WSL)

Are you learning WSL ? Try our test we designed to help you progress faster.

Test yourself