Limit the memory usage of WSL2-based projects
Edit on GitHubWhen running Spryker on WSL2, the memory usage of VMmem can get significant, even if the memory usage of the instance is small.
This document explains how to limit the memory usage of this process.
Prerequisites
Ensure that you have the latest versions:
- Windows 10 or Windows 11
- Docker for Windows
Limit the memory usage of VMmem
- Create or update
c:\users\USERNAME\.wslconfig
withmemory
andprocessors
parameters per your hardware and performance requirements.
The following example suits most use cases.
memory=4GB # Sets the memory limit to 4 GB.
processors=2 # Sets the number of CPU cores WSL2 is allowed to use to 2.
- Restart the LXSSMANAGER service:
- In the Start menu, enter
Services
and press Enter. - Right-click the LXSSMANAGER service and select Restart.
- In the Start menu, enter
After these steps, the VMmem memory usage does not exceed the specified limit.
Thank you!
For submitting the form