python, kernel_task hogging CPU

Recently, I've noticed Cee Pee You has reported 100% processor usage which doesn't decrease until I log out. When this happens Activity Monitor shows that both python and kernel_task each occupy over 45% CPU activity, leaving little for anything else.

Usually, I have Safari, Mail, Acquisition, and Activity Monitor open. Quitting any or all of them doesn't decrease the CPU load so I can't tell which one has caused Python to go wild. I have all the latest updates for Tiger including QT.

Can anyone guess what's happening? Is there anything else I can do to determine what program is misbehaving?

PB Ti 1 GHz  PB 17 1.33 GHz  iMac DV SE  iMac D  iPod mini  iPod Shuffle , Mac OS X (10.4.11),  Legacy (Appletalk) networked printers  23 years Apple!

Posted on Jun 21, 2008 9:23 PM

Reply
11 replies

Jun 22, 2008 10:22 PM in response to John Galt

Tough to tell... are you running a Mail server? The built in one uses Python /I think.

Have you installed any 3rd party Internet APPs/Helpers?

Have you checked...

See if there is anything relevent in...

/private/var/run/StartupItems
/Library/StartupItems
/System/Library/StartupItems

Aso look in in Your Accounts Pref Pane Login Items window.

Jun 23, 2008 6:08 AM in response to John Galt

John Galt wrote:
How can I find out what application is calling Python?


Try opening Activity Monitor, then switch to display "All Processes, Hierarchically". See if Python is indented just below and well to the right of another process. The upper process is its parent. Don't be fooled by the fact that the Python process will not have an icon, so it might look a bit indented. It's the process title that will be indented. As an example, look to "Activity Monitor" and "pmTool". pmTool is started by Activity monitor.

If you want to see what arguments were used to call the Python process, which could give more clues, use this Terminal command:

<pre class="command">ps -auxww | grep -i python</pre>

Finally, you can look and see if the Python process is reading or writing any files using the command:

<pre class="command">sudo fs_usage pid</pre>

Where "pid" is the process ID number of the python you're seeing hog the CPU. If you don't restrict by the PID, you'll be overwhelmed by the amount of reading and writing going on. When you're asked for your password, don't be alarmed that it won't echo back to you when you type it in. That's for security. To stop fs_usage, type the "control" - "c" combination on your keyboard.

charlie

Jun 23, 2008 6:05 PM in response to Charles Minow

It's Mail.

Charlie: setting Activity Monitor to show processes hierarchically is most helpful. The problem doesn't occur all the time but when it does Activity Monitor clearly shows Python's parent is Mail, and Python is taxing the CPU. Kernel_task's activity increases coincident with Python's, and of course kernel_task has no parent.

Now the interesting part: Quitting Mail doesn't cause Python to cease, it keeps on chugging. But what is its parent process, once Mail is no longer running? Good question! After quitting Mail, Python no longer appears when showing processes "hierarchically". It's not there. However, it reappears when selecting show "all processes".

I can force quit Python and all is well. It reappears nice and calm when re-launching Mail. Some time after Mail runs, perhaps after receiving some mail, Python goes crazy again.

By the way I'm not running a Mail server, and startup items aren't a factor.

So I'm much closer to solving the problem, but what is Mail doing that causes Python to go crazy?

Message was edited by: John Galt

Message was edited by: John Galt

Jun 23, 2008 6:16 PM in response to John Galt

John Galt wrote:
So I'm much closer to solving the problem, but what is Mail doing that causes Python to go crazy?


Ahh. Have you downloaded and installed any Mail plugins? Look in your user's Library folder for a folder called "Mail" and see if it has a folder called "Bundles" in it. If so, quit Mail, remove all the bundles (like to the desktop) in the "Bundles" folder, then add them back one by one, quitting restarting Mail in between. If it's one of the plugins, you'll find the culprit.

charlie

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

python, kernel_task hogging CPU

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.