STEAM GROUP
Steam Client Beta SteamBeta
STEAM GROUP
Steam Client Beta SteamBeta
12,935
IN-GAME
56,495
ONLINE
Founded
January 8, 2013
All Discussions > Bug Reports > Topic Details
Melody Oct 23, 2017 @ 10:16pm
[BUG] Memory Leak: Steam and audiodg.exe
This audiodg.exe problem has been discussed with Microsoft, now another Windows Insider User reported the same issue again, so they ended up to the conclusion that this is a problem with Steam, so I'm reporting it here as well. The only thing in common all the users have, is that they have Steam running in the background when this problem occurs. People without Steam running in the background are not experiencing this issue.

ISSUE
When Steam is open for many hours, the Microsoft process audiodg.exe experiences a Memory Leak due to Steam probably not properly releasing audio resources.

OS
Microsoft Windows 10 build 17017.rs_prerelease.171010-1400
Microsoft Windows 10 build 17017.rs_prerelease.171010-1000
Microsoft Windows 10 build 16299.19
Microsoft Windows 10 build 16299.15
Other OSes untested

STEPS
• Keep Steam open for some hours.

RESULTS
• The Windows process audiodg.exe experiences a memory leak.
• The Windows process audiodg.exe will experience high CPU utilization when trying to play audio files.
Screenshot from a Windows Insider user: https://fud.community.services.support.microsoft.com/Fud/FileDownloadHandler.ashx?fid=ca67b7dc-46df-4ed2-8e6e-e7bddb8a53a3
• Whenever the user closes Steam, audiodg.exe turns back to around ~20 MB of memory usage and low CPU usage.

EXPECTED
Nothing wrong to occur.

ADDITIONAL INFO / PERSONAL OBSERVATION
Every time a Steam sound plays, memory usage of audiodg.exe slightly increases.

WORKAROUND
Disable Steam sounds: go to Steam -> Settings -> Friends and disable all the sounds. This way, you won't hear any sounds when people send you text messages, but also audiodg.exe won't experience the Memory Leak.
Last edited by Melody; Oct 23, 2017 @ 11:43pm
< >
Showing 1-15 of 65 comments
2point4 Oct 24, 2017 @ 7:49am 
The audio device graph has been around since Vista. I remember this being a problem then and reporting it in exactly the same way to Valve that you just have. It was on the old SPUF forums so I can't link you to my old thread.

Point is, good luck getting this fixed but I hope that it finally does because it's just lazy and sloppy to have ignored it for this long.
Melody Oct 24, 2017 @ 7:56am 
Originally posted by 2point4:
The audio device graph has been around since Vista. I remember this being a problem then and reporting it in exactly the same way to Valve that you just have. It was on the old SPUF forums so I can't link you to my old thread.

Point is, good luck getting this fixed but I hope that it finally does because it's just lazy and sloppy to have ignored it for this long.
Microsoft is going to report this to Valve anyways, so there's a chance.
henryg Oct 24, 2017 @ 3:15pm 
Can you provide a link to the insider report?

This is literally the code we use to play the Friends UI sounds:
PlaySound( wavFileName, 0, SND_FILENAME | SND_ASYNC | SND_NODEFAULT | SND_NOSTOP );

We've been playing WAV files that way since Windows 95. If a Microsoft engineer thinks that this memory leak is our fault, I would looooove to have a discussion about it ;)
henryg Oct 24, 2017 @ 3:21pm 
This is an interesting thing to search the web for, as it turns out. Seems like a fundamental audio driver problem with "Sound Enhancements" and the PlaySound / MessageBeep / Beep APIs. Other threads point to having Cortana enabled being an issue, too.

https://answers.microsoft.com/en-us/windows/forum/windows8_1-performance/audio-device-graph-isolation-eats-up-memory/3366347f-f9ed-43de-9254-ee21937d2531

I don't think we can fix it from our side, there really is no simpler way to play sounds.
Last edited by henryg; Oct 24, 2017 @ 3:39pm
2point4 Oct 24, 2017 @ 3:59pm 
Other applications that play audio files, WAV or otherwise, don't necessarily exhibit this issue. So it's actually possible to have a functioning application that doesn't suffer from the problem that has been detailed multiple times over the course of the years now. I have noticed a few others over the years, but by and large apps that I use do no exhibit the same problem. Not only that, but like I pointed out Steam has had this problem since the audio device graph came along, so if Cortana is somehow involved it is entirely incidental and not at the root cause of the problem.

You close with:

Originally posted by henryg:
I don't think we can fix it from our side, there really is no simpler way to play sounds.

But there are applications that don't do this. So is it a case of you don't think it can be fixed from your side or you won't fix it from your side? Even if you've been playing sounds this way since Windows 95 (the year 2003 to be more specific) things change over time and you evolve to support newer standards. So if your old way of playing sounds is causing an issue on modern systems isn't it maybe time to look at updating the way Steam plays sounds?
henryg Oct 24, 2017 @ 4:42pm 
I'm sorry if I'm coming off as a bit insensitive here. I assure you that we hate memory leaks, we hate crashes, and we want Steam to run flawlessly on as many computers as possible! I'm just also compelled to point out that Steam will never run flawlessly on *all* computers.

It would be a lot easier to promise a fix if the problem actually occurred on any computer that we had access to. It doesn't happen on our workstations, it doesn't happen on my home computers, it doesn't happen on anything we have access to at the office, and many of the reporting users eventually find a workaround (without telling us what it is) and then stop replying to their support tickets.

Sure, we can change the API and use a (far more complicated) DirectSound or Windows Core Audio device API instead, but if shipping the Steam client has taught me anything personally, it is that changing to a new audio API will *assuredly* start crashing on tens of thousands of other computers that are currently working just fine.

Steam is, for better or worse, one of those apps that is so popular that video drivers and audio drivers scan for us specifically, and change their behavior based on whether or not a process is named "Steam.exe". Making any kind of major API change in an environment like that is super risky. I would much rather that Microsoft (or whichever driver author is ultimately responsible) fix this from their end.
henryg Oct 24, 2017 @ 4:56pm 
For what it's worth, I run Steam 24/7 on multiple Windows 10 computers (both for work purposes and to play games), including one computer on the Insider Fast Ring. I have never seen the audiodg.exe process exceed 5 megabytes of total memory usage, ever. So when people report that it "drops down to 20 megabytes after closing Steam", this tells me that there is something fundamentally wrong with their system, because 20mb is already way too high.
2point4 Oct 24, 2017 @ 6:35pm 
I've seen this problem on Vista, 7, 8, 8.1 and 10. I've seen it on AMD and Intel platforms, but only NVIDIA graphics-based systems (not that I think that has anything to do with it). And I've seen it on multiple integrated Realtek audio chipsets along with multiple discrete sound solutions from Creative Labs. I've seen lots of reports from others about this same problem. Not sure what hardware everyone else is using but if they're seeing the problem then they've seen it on one of the OSs I just listed. It seems that it's such a common occurrence across the PCs that I use that you would not be able to miss it, but eh...anything's possible.

So the next time I notice this happening on one of my PCs is there something I can do or provide for you that would help you diagnose this?
Melody Oct 24, 2017 @ 8:51pm 
Hi, I couldn't answer since I was sleeping.
Originally posted by henryg:
Can you provide a link to the insider report?

This is literally the code we use to play the Friends UI sounds:
PlaySound( wavFileName, 0, SND_FILENAME | SND_ASYNC | SND_NODEFAULT | SND_NOSTOP );

We've been playing WAV files that way since Windows 95. If a Microsoft engineer thinks that this memory leak is our fault, I would looooove to have a discussion about it ;)
Reports have been done through the Feedback Hub feature in Windows 10, so they're in the internal Bug Tracker. I'm reporting the issue here, Microsoft will already report the issue anyways to Valve, I'm just giving you a starting advantage.

We use the Play Sound function[msdn.microsoft.com] as well in our game to play 2D sounds (ie. hud sounds and menu sounds) and we're not experiencing any memory leaks, also please note that:
SND_ASYNC: The sound is played asynchronously and PlaySound returns immediately after beginning the sound. To terminate an asynchronously played waveform sound, call PlaySound with pszSound set to NULL.
To terminate an asynchronously played waveform sound, call PlaySound with pszSound set to NULL. Make sure you're doing it in the code after the sound has been played.

Now that I woke up, I just tried playing the same sound several times in our game and there's no memory leak.

Some audio card drivers automatically call a "Garbage Collector", as far as I'm concerned, so the memory leak doesn't happen. Instead, some people don't even notice it because they don't run Steam for many hours or they don't receive messages all the time: The "disabling Steam Sounds" workaround works perfectly fine and the Memory Leak doesn't occur at all, though Steam doesn't play any sound.

The system is ON for 15 hours now and I just woke up, audiodg.exe is using 5.2 MB with a music video open (but not playing). During these 15 hours I browsed the web with Microsoft Edge, played a lot of system sounds, compiled with VS2017, used the Serious Editor (Editor for Serious Sam) and played some Serious Sam.

Last time I woke up and friends sent me messages while I was sleeping, I found audiodg.exe using 1800 MB+ of RAM and, once I closed Steam, memory usage went down to 3.2 MB. Clearly a Steam issue, since I don't have it on any other software, and even on our game.

Also, while playing games of any sort, even for hours and hours, I don't experience memory leaks. Same thing applies when using other programs for hours, such as CyberLink PowerDirector or Sony Vegas 13.0.

The only software having issues is Steam. It happens on both integrated Realtek HD Audio and my Sound Blaster Z. I tried 2 different drivers for the integrated Realtek device:
• Realtek High Definition Audio (Realtek's one)
• High Definition Audio Device (Microsoft's one)
And I experience the same issue.

I tried to deploy a clean Microsoft WIM image of the Fall Creators Windows 10 (16299.15) onto an external USB SSD and booting it to see if the error still happens, and yes, it still happens with both HDAD and RHDA drivers, and both integrated card and Sound Blaster card.
Originally posted by henryg:
I'm sorry if I'm coming off as a bit insensitive here. I assure you that we hate memory leaks, we hate crashes, and we want Steam to run flawlessly on as many computers as possible! I'm just also compelled to point out that Steam will never run flawlessly on *all* computers.

It would be a lot easier to promise a fix if the problem actually occurred on any computer that we had access to. It doesn't happen on our workstations, it doesn't happen on my home computers, it doesn't happen on anything we have access to at the office, and many of the reporting users eventually find a workaround (without telling us what it is) and then stop replying to their support tickets.

Sure, we can change the API and use a (far more complicated) DirectSound or Windows Core Audio device API instead, but if shipping the Steam client has taught me anything personally, it is that changing to a new audio API will *assuredly* start crashing on tens of thousands of other computers that are currently working just fine.

Steam is, for better or worse, one of those apps that is so popular that video drivers and audio drivers scan for us specifically, and change their behavior based on whether or not a process is named "Steam.exe". Making any kind of major API change in an environment like that is super risky. I would much rather that Microsoft (or whichever driver author is ultimately responsible) fix this from their end.
I'm definitely weirded out that you're not experiencing the issue on all your test machines. As I said, some audio drivers probably call an automatic Garbage Collector. Low latency audio cards, such as the ones with ASIO drivers (like mines), shouldn't call GC every time because it would increase latency a lot. This is just a theory of mine, but I think it's the most logical answer I can give you about the problem. The issue happens only on some hardware configurations and only on advanced audio cards. The integrated card I'm using has some advanced technologies:
• MSI SoundBoost
• Nahimic
• ASIO Drivers
So it is clearly not a "standard" integrated audio device, it has some advanced features, such as native ASIO support (the Sound Blaster Z has too, of course).
Originally posted by henryg:
For what it's worth, I run Steam 24/7 on multiple Windows 10 computers (both for work purposes and to play games), including one computer on the Insider Fast Ring. I have never seen the audiodg.exe process exceed 5 megabytes of total memory usage, ever. So when people report that it "drops down to 20 megabytes after closing Steam", this tells me that there is something fundamentally wrong with their system, because 20mb is already way too high.
Well, no. If you're running an audio application that is constantly emitting a single sound (or more sounds), the process needs AT LEAST 4.2 MB in the best case. Most of the times, depending on buffer size, sound quality and bit-depth, the process needs something like 6.87 MB of RAM in order to emit a single sound.

Unfortunately, the problem is with Steam and devs have to deal with it and fix it, I hope that my explanation was clear enough.

Microsoft will report the problem directly to Valve soon by the way.
Last edited by Melody; Oct 24, 2017 @ 8:55pm
henryg Oct 24, 2017 @ 9:23pm 
I wish that I could reproduce this! But hopefully one of you who are experiencing the issue can run a test for me.

Here is an easy way to get Steam to play a bunch of sounds, repeatedly:
- Open the Settings dialog, go to Account, and under Beta Participation, click Change. This brings up a modal dialog box.
- Now without dismissing the dialog box, try to click on the main Steam window - this will play a warning bell sound.

Does memory usage of audiodg.exe go up as you click repeatedly? I have tried clicking for a minute straight and I can't get audiodg.exe to go above 5.6 MB. The expected behavior is that the memory usage goes up by ~300 KB while the bell sound is playing, and drops immediately back down after the bell sound is complete.
Melody Oct 24, 2017 @ 9:40pm 
Originally posted by henryg:
I wish that I could reproduce this! But hopefully one of you who are experiencing the issue can run a test for me.

Here is an easy way to get Steam to play a bunch of sounds, repeatedly:
- Open the Settings dialog, go to Account, and under Beta Participation, click Change. This brings up a modal dialog box.
- Now without dismissing the dialog box, try to click on the main Steam window - this will play a warning bell sound.

Does memory usage of audiodg.exe go up as you click repeatedly? I have tried clicking for a minute straight and I can't get audiodg.exe to go above 5.6 MB. The expected behavior is that the memory usage goes up by ~300 KB while the bell sound is playing, and drops immediately back down after the bell sound is complete.
Yes, it increases of exactly 0,8 MB every time the sound plays, and it never decreases.
https://i.imgur.com/gsi8NkL.png (it's the third program in the list).

The only ways to "reset" it are:
• Disabling and re-enabling the audio device.
• Changing frequency and/or enhancements in audio properties and clicking on Apply.
• Rebooting Steam of course.
Last edited by Melody; Oct 24, 2017 @ 9:43pm
2point4 Oct 24, 2017 @ 9:55pm 
Originally posted by henryg:
I wish that I could reproduce this! But hopefully one of you who are experiencing the issue can run a test for me.

Here is an easy way to get Steam to play a bunch of sounds, repeatedly:
- Open the Settings dialog, go to Account, and under Beta Participation, click Change. This brings up a modal dialog box.
- Now without dismissing the dialog box, try to click on the main Steam window - this will play a warning bell sound.

Does memory usage of audiodg.exe go up as you click repeatedly? I have tried clicking for a minute straight and I can't get audiodg.exe to go above 5.6 MB. The expected behavior is that the memory usage goes up by ~300 KB while the bell sound is playing, and drops immediately back down after the bell sound is complete.
This does not trigger the memory leak for me. What does happen, however, is that it triggers audiodg.exe to begin using some CPU time. And then audiodg.exe never stops using that amount of CPU time. The only way to get that to stop is to exit Steam. Not sure what the difference is between Steam startups each time, but sometimes just starting Steam will trigger this CPU usage within audiodg.exe and other times it won't begin again until Steam plays a sound.
henryg Oct 24, 2017 @ 10:01pm 
Wow. That is crazy. Thanks so much to both of you for confirming the (different, but clearly related) specific issues. Ok, one more test if you have the time - in Task Manager, it happens to be the case that they use a similar API to play a sound if you hit an unknown keystroke. So if you are in Task Manager and hit, say, Alt + K - it should make a warning ding. What happens to the audiodg.exe memory usage in that case? Does it go up and then back down?
Last edited by henryg; Oct 24, 2017 @ 10:03pm
henryg Oct 24, 2017 @ 10:05pm 
And one more quick test - if you have any music tracks in your Steam library, and you start and stop the music repeatedly or switch tracks in the Steam music player interface - does the memory usage and CPU also go up? Or does it remain constant?

If that works, I'm thinking that the safest fix is probably to play all our sounds as if they are music tracks instead, and never ever call PlaySound because it clearly interacts badly with something on your systems.
Last edited by henryg; Oct 24, 2017 @ 10:07pm
Melody Oct 24, 2017 @ 10:09pm 
Originally posted by henryg:
Wow. That is crazy. Thanks so much to both of you for confirming the (different, but clearly related) specific issues. Ok, one more test if you have the time - in Task Manager, it happens to be the case that they use a similar API to play a sound if you hit an unknown keystroke. So if you are in Task Manager and hit, say, Alt + K - it should make a warning ding. What happens to the audiodg.exe memory usage in that case? Does it go up and then back down?
Yes, the memory goes up and then back down, no memory leak at all.
Originally posted by henryg:
And one more quick test - if you have any music tracks in your Steam library, and you start and stop the music repeatedly or switch tracks in the Steam music player interface - does the memory usage and CPU also go up? Or does it remain constant?

If that works, I'm thinking that the safest fix is probably to play all our sounds as if they are music tracks instead.
No, there's no memory leak in that case.

Also, have you tried my above suggestion?
SND_ASYNC: The sound is played asynchronously and PlaySound returns immediately after beginning the sound. To terminate an asynchronously played waveform sound, call PlaySound with pszSound set to NULL.
Just asking.
Last edited by Melody; Oct 24, 2017 @ 10:10pm
< >
Showing 1-15 of 65 comments
Per page: 1530 50

All Discussions > Bug Reports > Topic Details
Date Posted: Oct 23, 2017 @ 10:16pm
Posts: 65