[WSLg / audio] Windows Audio service (Audiosrv) leaks ETW registrations while Linux apps play sound; kernel pools reach tens of GB
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 8/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- operating-systems
Research direction
Read the full write-up in the first comment and the attachments before touching anything: the WPR pool trace summary ties 99.97% of the EtwD/Etwr allocations to the svchost hosting Audiosrv. Reproduce with the paplay loop against the RDPSink PulseAudio sink while sampling tags with the attached etwtags.ps1 or poolmon, then compare against a WSLg audio path where streams are opened and closed once. Done means those ETW registrations are released when a stream closes and pool growth stays flat under the loop.
Written by the indexing model from the issue text.
Description
Windows Version
Windows 11 25H2, build 26200.9711
WSL Version
WSL 3.0.5.0, kernel 6.18.58.1-1, WSLg 1.0.79
Are you using WSL 1, WSL 2, or WSLC?
- WSL 2
- WSL 1
- WSLC
Kernel Version
6.18.58.1-1
Distro Version
Ubuntu 24.04
Other Software
-
Windows 11 25H2 (10.0.26200.9711)
-
WSL 3.0.5.0, kernel 6.18.58.1-1, WSLg 1.0.79, MSRDC 1.2.7391
-
Ubuntu 24.04, PulseAudio from WSLg, default sink RDPSink
-
.wslconfig: memory=20GB, swap=8GB, networkingMode=mirrored, autoMemoryReclaim=gradual
Repro Steps
-
In a WSL2 distribution with WSLg (default PulseAudio sink "RDPSink"),
create a short silent clip and open/close audio streams in a loop:python3 -c "import wave; w=wave.open('/tmp/s.wav','wb'); w.setnchannels(2); w.setsampwidth(2); w.setframerate(48000); w.writeframes(bytes(9600)); w.close()"
while :; do paplay /tmp/s.wav; done -
On Windows, watch the kernel pool tags EtwD (paged) and Etwr (nonpaged),
e.g. with the attached etwtags.ps1 (20 s delta, no elevation needed):powershell -ExecutionPolicy Bypass -File .\etwtags.ps1 20
or with poolmon from the WDK (tags EtwD, Etwr).
-
The same happens with any Linux app that plays sound for a long time;
we first saw it with a game (Diablo IV through Wine/Proton): over a few
hours the pools grew to tens of GB and WSL stopped responding.
A pool-allocation trace (wpr -start Pool) attributes 99.97% of the EtwD/Etwr
allocations to the svchost.exe that hosts only Audiosrv (Windows Audio);
summary attached.
Expected Behavior
Opening, playing and closing audio streams from WSLg does not grow kernel
pool usage; ETW registrations made for a stream are freed when it closes.
Actual Behavior
EtwD and Etwr grow one-to-one (each pair looks like one ETW registration),
allocated by Audiosrv:
- About 2,000 registrations per audio stream opened and closed
(+25,207 in 20 s for 13 paplay runs; preliminary, measured while earlier
leaked registrations were still being freed). - While a stream is active, the slow freeing of earlier registrations stops.
- With a game playing sound: 680 to over 6,000 per second, after the first
minutes of a session. - After the Linux app exits they are freed at only ~3,000-4,400 per second.
Result on a 31 GB machine: paged pool 60 GB (EtwD 52.7 GB, 115 M
allocations), nonpaged 11 GB (Etwr 8.7 GB), commit 110.9 of 112.1 GB; WSL
stopped responding and needed wsl --shutdown. Both pools were below 1.1 GB
after a reboot.
Diagnostic Logs
Attachments: WPR pool trace summary, pool tag snapshots, measurement scripts. Full write-up in the first comment. The 12 GB ETL is available on request.
- Dominant language
- C++
- Stars
- 34.4k
- Forks
- 1.9k
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 166
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/WSL
-
feature wsl2
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
microsoft/WSL#42306 · 3 comments ·
Maintainers usually reply within 1 day
-
feature
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
microsoft/WSL#42114 · 3 comments ·
Maintainers usually reply within 1 day
-
feature kernel wsl2
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
microsoft/WSL#41107 · 3 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
feature kernel
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
microsoft/WSL#41054 · 9 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
feature GPU
Difficulty 1/5 1-3 hours Newbie friendliness 70/100
microsoft/WSL#13592 · 4 comments ·
Maintainers usually reply within 1 day
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
nextcloud/passman-android#214 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
2026.11.0 fails to install on Intel macOS: requirements.txt pins cryptography==50.0.2 for Darwin x86_64May be free again A pull request for this issue was closed without being merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 87/100
esphome/esphome#22892 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
distante/esphome-components#50 · 1 comment ·
Maintainers usually reply within 1 day
-
arch-based hyprland
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
noctalia-dev/noctalia#5423 ·
Maintainers usually reply within 1 day