Recover from a runaway netstat process

Aug 23, '04 12:11:00PM

Contributed by: robg

For quite a while now, my G5 has been exhibiting an occasional odd problem on wake from sleep: both CPUs usage meters are pegged (which I can see in a split second, thanks to the MenuMeters graph in the menubar). When I look at top -u 10 in the Terminal, I see that a process named netstat is sucking up nearly 100% of both CPUs. A quick man netstat shows that this really isn't a process that should be continuously running: "The netstat command symbolically displays the contents of various network-related data structures."

The hint for solving the problem is simple: just kill the process. However, since it's owned by root, you'll need to do so with root powers, i.e. sudo killall netstat. As soon as the process is killed, CPU usage goes back to normal, and the netstat process doesn't spontaneously restart ... except when I again wake from sleep (but only sometimes).

I have no idea what's causing the problem, but the solution is relatively painless ... and it turns out that I'm not alone in my troubles; there's a two-page discussion on this very subject over on our forum site. The issue might be related to non-standard entries in /etc/hosts, or related only to G5s, though nothing has been proven at this point. Please feel free to add to the thread on the forums if you have any insights; the comments here are not intended to help troubleshoot the issue -- that's why we have a forum site :).

Comments (14)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20040823091145835