Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSL2 VM crashes and starts using all available host memory #7215

Closed
1 of 2 tasks
radu-matei opened this issue Jul 22, 2021 · 5 comments
Closed
1 of 2 tasks

WSL2 VM crashes and starts using all available host memory #7215

radu-matei opened this issue Jul 22, 2021 · 5 comments

Comments

@radu-matei
Copy link

Windows Build Number

10.0.19043.1147

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

4.19.128

Distro Version

Ubuntu 20.04

Other Software

No response

Repro Steps

Unfortunately, I don't have much information here, as the crash happened randomly - the distro became unresponsive, and the Vmmem process started using all available memory on the host:

image

I had to manually terminate the process, as wsl --shutdown didn't work.

Hopefully this was a one-off crash, but wanted to start documenting it.
In case it happens again, I'll try to provide some more logs and environment info.

Expected Behavior

Actual Behavior

Diagnostic Logs

No response

@shpirt
Copy link

shpirt commented Jul 22, 2021

#4166
About the memory, this issue has been introduced for two years since the first version of wsl2 and haven't get repaired.
One workaround is set a limit to memory usage in wslconfig which you can find it in the link above.

@WSLUser
Copy link

WSLUser commented Jul 29, 2021

This is a valid issue. Despite setting a limit, it's possible for the WSL2 VM to ignore that limit and make the entire OS nearly impossible to do anything with. Rebooting is the only solution there. I had this happen myself a couple days ago when compiling a custom kernel. Also the Free-Page Reporting patch is available in both the WSL2 5.10 kernel as well as the mainline kernel, which almost renders #4166 "fixed" as memory is supposed to be freed up when it is no longer required. I had this option available and enabled and was useless. (but I have seen instances of it working when viewing Task Manager, which makes this a VM specific issue though still possible there's a bug with the Free-Reporting patch).

@craigloewen-msft
Copy link
Member

I'll keep this open so I can keep an eye on this, it's not a bug we've seen. If you do see this again let us know if there are any repro steps!

@bravik
Copy link

bravik commented Aug 17, 2021

I would add that it uses not only memory, but CPU too..
In my case it happens several times per day, constantly using 25% of CPU and eating up all available RAM until system becomes unresponsive...
Even when I terminate Docker, PhpStorm and other tools I use with WSL it keeps eating CPU and RAM, untill I restart LxssManager service

Actually when WSL come out I was welcoming it as a relief.. but now it causes constant pain with issues like that.. And thoughts about buying Mac for development...

Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants