Összes téma > Steam fórumok > Steam for Mac > Téma részletei
Steam causing memory leak on OS X Mavericks
I've been noticing over the last few weeks that something keeps consuming my hard disk space and after a bit of digging it appears I have come across the (or at least a) culprit: Steam.

In particular, as long as Steam is running on my computer, the distnoted process (the distributed notification daemon) leaks a few kilobytes of memory per second. Since I've been leaving Steam running in the background, this adds up over a few days to gigabytes of memory, eating up both physical memory and eventually swap space.

Running the terminal command sudo dtruss -p <pid of distnoted> while Steam is running displays about a dozen lines per second which mostly look like:

kevent64(0x3, 0x7FFF7C9B3130, 0x1) = 1 0
workq_kernreturn(0x20, 0x0, 0x1) = 0 0
workq_kernreturn(0x20, 0x0, 0x1) = 0 0
kevent64(0x3, 0x7FFF7C9B3130, 0x1) = 1 0
workq_kernreturn(0x20, 0x0, 0x1) = 0 0
workq_kernreturn(0x20, 0x0, 0x1) = 0 0

These lines do not appear nearly as frequently if I quit Steam.

I'm not familiar with the internal workings of Steam, but looking over the NSDistributedNotificationCenter reference (https://developer.apple.com/library/mac/documentation/cocoa/reference/foundation/classes/NSDistributedNotificationCenter_Class/Reference/Reference.html), my guess is that steam is either repeatedly calling - addObserver: or is posting notifications faster than the observers are consuming them.
< >
1629/29 megjegyzés mutatása
I think you can kill it. It's what I do, too.

Distnoted is used by other applications as well. However, with distnoted memory leakage those application are likely waiting longer than usual for the notifications to go through.
- Killing distnoted speeds up stuff for those applications as well.
- A well-written application will resend all notifications that were lost in the queue. Because most applications will use Apple's API instead of interacting with distnoted directly, that's a safe assumption.
- Resending those notifications happens so fast that you won't notice the 'restart' phase for those applications.
This still occurs in the latest version of steam, more than a month after the original report. Is there a better place to report bugs with the client?
Having the same problem
I posted a bug report in this forum http://steamcommunity.com/groups/SteamClientBeta/discussions/0/616189742887319167/ Hopefully someone will look at it.
Just got back into steam after summer - and new version is crashing all the time. Must be this issue. 27" iMac - latest OSX.
bump, removing steam from the mac for now #crapware
Paste the following test into a script and run it to safely kill distnoted if it's hogging memory:

#!/bin/bash
MEM_LIMIT_PERCENTAGE=0.5
CHECK_INTERVAL=60
while true
do
PID=`ps -f -U $USER | grep /usr/sbin/distnoted | grep -v grep | tr -s ' ' | cut -d ' ' -f 2`
MEM_USAGE=`ps -o %mem -p $PID | sed 1d`
if [ `echo "$MEM_USAGE > $MEM_LIMIT_PERCENTAGE" | bc` = "1" ]; then
echo "Mem usage high. Killing distnoted"
kill -9 $PID
else
echo "Mem usage within bounds"
fi
sleep $CHECK_INTERVAL
done

For those interested in the details, it greps for distnoted process being run by the user, checks it memory, and kills it if its using more than 0.5% of the computer's memory. It checks every 60 seconds by default.
PS: Dont run it as root user.
so how can I do this? I see that it's eating up a ton of my memory too, I just don't know how I can kill the distnoted process.
Complete noob here too but i've noticed that when i quit steam my laptop goes back to normal. Anyway of improving or fixing this?
This explains a lot! My hard disk appears to be 90% capacity but does not appear to be running slower or crashing any apps. Neither do I get the continually freeze/crash that you would associate with such a crammed HD. I have been running Steam & MacGamestore 24/7, I must try closing and then checking disc capacity
Seems like it's finally fixed (for me) in the most recent beta client?
Steam has a terrible sense of duty when it comes to mac optimization. Valve in general, does. CS:GO now uses about 9 times as much memory as it did before one of the most recent updates. Because of this, it is almost unplayable on my computer, even with the bare minimum settings. Before, I had no issue. I'm terrified to update anything, client or game wise, because theres always the chance its going to completely screw everything up.
How do i kill distnoted though?
Its fixed for me now, and apparently others as well. So probably not a problem after recent updates.
< >
1629/29 megjegyzés mutatása
Laponként: 1530 50

Összes téma > Steam fórumok > Steam for Mac > Téma részletei
Közzétéve: 2014. aug. 18., 2:07
Hozzászólások: 29