Docker Desktop's "resource saver mode" causes WSL to "lock" when AutoMemoryReclaim is set to gradual
Windows Version
Microsoft Windows [Version 10.0.22621.3007]
WSL Version
2.0.14.0
Are you using WSL 1 or WSL 2?
- [X] WSL 2
- [ ] WSL 1
Kernel Version
5.15.133.1-1
Distro Version
Ubuntu 22.04
Other Software
Docker Desktop 4.26.1 (131620) - Windows version
Repro Steps
When Docker Desktop is running but is in "Resource Saver" mode, running any command that has to read from the disk will "hang" until I manually "wake up" Docker from its Resource Saver mode (by running a container for example).
I'm not really sure about the "read from disk" part, but it's been the common denominator of commands affected by this (e.g. apt, ls, lsof are all affected, while zsh scripts that are already running or top/htop aren't).
This issue happens when Docker Desktop is running in resource saver mode AND WSL's autoMemoryReclaim is set to gradual.
I've tried the following scenarios and they don't seem to cause the issue:
autoMemoryReclaimis set todropcacheautoMemoryReclaimis disabled (commented out in.wslconfig)- Docker Desktop is running in its normal mode
- Docker Desktop isn't running at all
For now I have autoMemoryReclaim set to dropcache, but if you want me to run additional tests or need some other info let me know.
Expected Behavior
Expected the normal command behavior.
Actual Behavior
I've taken a screen recording while the issue happens:
https://github.com/microsoft/WSL/assets/56894914/64ac6b36-90a3-44af-89d5-83fe4e5d864e
Diagnostic Logs
Those are the corresponding WSL logs for the screen recording:
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Open similar issues:
- WSL 2 Loss of resource control settings compared to old WSL , on Docker Desktop (#9537), similarity score: 0.72
Closed similar issues:
- Docker CE no longer works with WSL 2.0.0 and
autoMemoryReclaim=gradual(#10497), similarity score: 0.79
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
I also see this with Ansible commands, even ansible --version. If I restart docker or just run any docker command that contacts the daemon, the hanging commands immediately resume.
I am also seeing this. I got the hunch that anything accessing the network also hangs, not just what's accessing the file system.
I am facing the same issue. Maybe related to #10378
same issue here.
it's actually just slowing down the system a lot but not hanging indefinitely.
one can see this if you ran "service --status-all". it takes minutes to list services one by one. if i stop docker desktop, then the command finishes quickly.
My problem is similar but not identical. I am running WSL2 Ubuntu 22.04. I can run ls and even apt list without problem. They complete instantly. However, running sudo apt-get update hangs indefinitely when Docker Desktop is in "Resource Saver mode".
To fix it, all I have to do is click on the Resume button in Docker Desktop. Then sudo apt-get update runs instantly
Note that I also confirmed that I do have autoMemoryReclaim=gradual set in ~/.wslconfig
> wsl -v
WSL version: 2.2.4.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.61
MSRDC version: 1.2.5326
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26091.1-240325-1447.ge-release
Windows version: 10.0.22631.4037
I also just updated Docker Desktop today, and the problem persists with Docker Desktop 4.33.1 (161083)
$ docker --version
Docker version 27.1.1, build 6312585
Possibly the root cause is related to systemd and/or cgroupsv2. I ran into this when I set autoMemoryReclaim = gradual to solve a systemd 256 issue (#11857). That issue has two possible workaround. Either set autoMemoryReclaim = gradual, or add in .wslconfig:
[wsl2]
kernelCommandLine = cgroup_no_v1=all systemd.unified_cgroup_hierarchy=1
With autoMemoryReclaim disabled, but kernelCommandLine added to force cgroupsv2, WSL would also freeze for me when Docker Desktop entered Resource Saver mode.
Possibly the root cause is related to systemd and/or cgroupsv2. I ran into this when I set
autoMemoryReclaim = gradualto solve a systemd 256 issue (#11857). That issue has two possible workaround. Either setautoMemoryReclaim = gradual, or add in.wslconfig:[wsl2] kernelCommandLine = cgroup_no_v1=all systemd.unified_cgroup_hierarchy=1With
autoMemoryReclaimdisabled, butkernelCommandLineadded to force cgroupsv2, WSL would also freeze for me when Docker Desktop entered Resource Saver mode.
I confirm that removing the kernelCommandLine fixes this for me. I don't have autoMemoryReclaim set so not sure about that.
To easier reproduce, enable this option, and pause docker engine in WIndows. Then the WSL would freeze.
... Incomprehensible Linux stuff snipped ...
[wsl2] kernelCommandLine = cgroup_no_v1=all systemd.unified_cgroup_hierarchy=1I confirm that removing the kernelCommandLine fixes this for me. I don't have autoMemoryReclaim set so not sure about that. ...
Do you mind explaining shortly what that kernel command line does? As in, what does it activate/deactivate/change?
Also, it doesn't exist by default in .wslconfig, so I assume the recommendation is to add it so it does its thing, right?
In WSL 2.5.1 they removed cgroupv1 support. I removed my .wslconfig and upgraded to this version and Docker Desktop still freezes WSL when it's paused. So as of this version it'll cause your WSL to freeze even if you did not make any changes to .wslconfig.
I have the same issue, it would cause other distro's wsl ssh port-forwarding to freeze
I am seeing the same issue in WSL 2.5.7.0 with the default settings (.wslconfig is empty). Apparently DropCache is the default value, and I am still seeing WSL hang. If I manually instruct Docker to wake up the engine, WSL comes back to life.
Same issue here. Started experiencing it as of the last month. Upgrading Docker Desktop doesn't fix it either, only clicking resume in the Docker Engine as others have mentioned
Experiencing the same issue on WSL version: 2.5.7.0 with minimal .wslconfig. WSL completely hangs when Docker enters resource saving mode. Started experiencing it within the last two weeks.
The same hanging symptoms with Docker Desktop for Windows v4.41.2, WSL version: 2.5.8.0 (Kernel version: 6.6.87.1-1) and autoMemoryReclaim is set to dropcache.
Of note, reproduction of this issue is even simpler than adjusting settings. Regardless of autoMemoryReclaim, simply:
- Run WSL (
wslon command line) - Run Docker Desktop
- Hit the "Pause" button on the "Engine running" section in Docker Desktop (imaged above, resource saver can cause this).
- WSL will be frozen at any point this pause is active, and resumes once unpaused.
Perhaps I lack some background information, but I don't feel that docker's engine being paused should make my personal WSL2 distro completely unresponsive.
Versions:
Ubuntu: 24.04.1 LTS
Docker Desktop version: 4.41.2
WSL version: 2.5.7.0
Kernel version: 6.6.87.1-1
WSLg version: 1.0.66
MSRDC version: 1.2.6074
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.22621.5335
With this in mind (in addition to several other "workarounds" like attempting to disable Windows 11's efficiency mode), my current approach is to disable "Resource Saver" in the docker settings:
I am now experiencing much less frequent freezing (None so far, as of writing...).
I'm currently experiencing this issue myself. I was able to reproduce it with @1Rogue's steps and his workaround seems to be holding up.
This has to be related to a recent update—either Windows, Docker Desktop, or WSL (wsl --update)—since I've been using Docker Desktop and Ubuntu for over 2 years and never had this problem before.
Started seeing this behavior about a week, maybe two weeks ago.
Recent Updates
Get-HotFix | Sort-Object InstalledOn -Descending | Select-Object HotFixID, Description, InstalledOn
| HotFixID | Description | InstalledOn |
|---|---|---|
| KB5059502 | Update | 5/29/2025 12:00:00 AM |
| KB5058499 | Update | 5/29/2025 12:00:00 AM |
| KB5056579 | Update | 4/29/2025 12:00:00 AM |
System Information
- NO custom
.wslconfig file - Ubuntu: 24.04.2 LTS
- Docker Desktop version: 4.42.0
- WSL version: 2.5.7.0
- Kernel version: 6.6.87.1-1
- WSLg version: 1.0.66
- MSRDC version: 1.2.6074
- Direct3D version: 1.611.1-81528511
- DXCore version: 10.0.26100.1-240331-1435.ge-release
- Windows version: 10.0.26100.4202
There's a dev build with a possible fix here: https://github.com/docker/for-win/issues/14656#issuecomment-2956142140
That 4.43.0 dev version fixed it for me.
Happens to me for the last two days, most likely since KB5058411 and KB5054979 have been installed. Disabling Docker Resource Saver fixes it immediately (meaning stalled processes and windows are revived instantly , without restarting WSL)
It's related to docker desktop.
https://github.com/docker/for-win/issues/14656#issuecomment-2966487210