-
Notifications
You must be signed in to change notification settings - Fork 823
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
Memory Leak / Thousands of abandoned wsl.exe instances (WSL Preview) #8703
Comments
Looks like a server, waay beyond me. But anyway, lets hope your issue gets sorted. |
/logs |
Hello! Could you please provide more logs to help us better diagnose your issue? To collect WSL logs, download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
The scipt will output the path of the log file once done. Once completed please upload the output files to this Github issue. Click here for more info on logging Thank you! |
WslLogs-2022-08-11_15-41-06.zip Here is a log after a reboot. Therefore the memory is mostly clear, but during the log, some wsl instanced have already crashed and restarted a few times. I'll add another log file after a few days, when the memory leak has filled up the ram some more. |
WslLogs-2022-08-12_11-20-05.zip |
I am experiencing the exact same issue if I can help. My only difference is all of my zombie |
Thank you for the logs @mrgreywater. This is an interesting issue, I see some relaying errors in the logs, but nothing that explains the zombies. Can you share a dump of one of those wsl.exe zombies, only with a dump of wslservice.exe ? |
Ive found that docker desktop Be careful if you do revert, you need to uninstall your current docker desktop which will delete all containers, volumes, images etc in order to then install the version you want. Be sure to backup! |
@kaitallaoua I noticed it has to do with Docker, but reverting to an old version may work for now, but the underlying issue has to be figured out still. The fact that it is even possible to create such zombie processes that are not cleaned up by the os - even though they are terminated - makes me believe the actual bug may be rooted in the os/driver/hypervisor. |
@OneBlue So after some fiddling around with gflags.exe and windbg, I've got some dumps: https://drive.google.com/file/d/1hEjdTG0JMGspXIYouA8PYZiB335lE2wB/view?usp=sharing
|
Appearently there's been a fix that will be published with the next Docker for Windows release, I'll close this issue as soon as it's available and confirmed to be working. |
@mrgreywater Where did you see that? I Have the same problem which can be reproduced when running an apache server image of any kind.... Its probably a docker problem since its keeping handles to those zombie processes so they are not cleaned and stay there forever occupying the page table. |
Appears to be fixed with Docker v4.12 |
Version
Microsoft Windows [Version 10.0.22000.832]
WSL Version
Kernel Version
5.10.102.1
Distro Version
Ubuntu-20.04
Other Software
Docker Desktop 4.11.0 (83626)
Repro Steps
Run wsl with various docker images for some multiple days.
Expected Behavior
Memory usage stays somewhat consistent.
Actual Behavior
Memory usage goes up, but is not associated to any running process in Task Manager. Memory Space just "vanishes". In RamMap, thousands over thousands of abandoned wsl.exe processes are listed (pid not actively running anymore), each still consuming a small amount of RAM.
The creation of those abandoned wsl.exe processes continues with time until no memory is left. At that point windows itself becomes unusuable. Mouse cursor begins to lag, audio crackles. At some point the whole system becomes unresponsive.
Only a full system restart clears the memory back to normal levels.
wsl --shutdown or restarting the WSL service has no impact on the zombie processes.
Diagnostic Logs
System has 32 Gigabytes of Ram, wsl consumes around 10 Gigabytes after the first day, consumes almost all of it after a few days, not visible as active processes, traces only visible in Rammap.
In RamMap, notice the large amount of unused active memory and large page table
In ProcessHacker, you can see a wsl.exe instance being created and closed every few seconds:
https://user-images.githubusercontent.com/2902403/183592815-75add970-ef56-48cf-b76e-559e1c9a86f8.mp4
Here are the currently running filter drivers (doubt they are the culprit though):
The text was updated successfully, but these errors were encountered: