Kill the out of control python in Tiger!
February 13, 2006 9:36 PM

In the past few weeks I have started to notice a strange problem in OS X - a process called 'python' starts and will not stop on its own.

I'm running Tiger 10.4.4. I have noticed that occasionally the fan in my Mini goes on for extended periods of time and when I check the SysStat Dashboard (or top in the terminal) I notice a process called python that is taking up 35%+ of CPU. Load Averages generally go up to 2.x or so when this occurs.

It's easy enough to note the process number in the dashboard and then open up a terminal and kill the process, and there have been no noticable negative side effects of doing so. I suspect that something I do in Firefox might be calling this process in sort of an old-school plugin behaviour, but I have poked around and can't find any mention of anything like that happening.

I would much prefer to figure out what this is and figure out how to prevent it from occurring (if possible).
posted by mikel to Computers & Internet (8 answers total)
Python is a popular scripting language, much like Perl, SH, JavaScript, etc. Every install of OS X comes with a version of Python and the system uses it to do some of its tasks (a very common strategy in the Unix world).

I'm guessing your script that is doing an index process, cleaning out logs, or the like. Just knowing that it is "python" doesn't tell you much, you need to know the parameters. Next time, from a terminal run "ps auxw | grep [pid]" (where [pid] is the process ID of the python process). You should be able to tell what script is eating up your CPU.
posted by sbutler at 10:09 PM on February 13, 2006


Ohhh... and it's almost certainly not Firefox. Could be a dashboard widget though.
posted by sbutler at 10:09 PM on February 13, 2006


pstree can help find the path of processes python is being launched from. depending on your interest, you may find using strace (or equivalent) / gdb to debug and trace the running process informative, but it may be over your head (no offense intended).
posted by kcm at 10:28 PM on February 13, 2006


The 'Activity Monitor' app that comes with OS X has a couple of useful features, and might be easier than the command line. It's in /Applications/Utilities/.

Fire it up, and select the process you're interested in. Hit 'Inspect', and it'll show you some additional info about the process. In particular, for most active processes it'll show you a list of that process' open files, which might give you a clue as to what it's up to.

It'll also show you the process' parent process, and if you click on it you'll get an Info window for that process. Using this you can trace back and find out what actually launched the 'python' process in the first place.

Pretty much the same stuff that kcm suggested, just in a GUI format.
posted by chrismear at 11:42 PM on February 13, 2006


Python is an interpreter, it runs some other program. If you open a terminal and type in the following:
ps axl | grep python
it should tell you its commandline arguments, including the name of the python program it's running. From that you should be able to figure out where it's from.
posted by polyglot at 1:57 AM on February 14, 2006


You're not running a bittorrent client, are you?
posted by yerfatma at 4:26 AM on February 14, 2006


Many dashboard widgets use Python. That TV Tracker one, for instance.
posted by unixrat at 7:16 AM on February 14, 2006


Followup - I followed chrismear's advice and figured out that it was Junkmatcher that was causing the problem. Since I don't really need that (it was just extra help, not my main spam fighting solution), I removed it and the problem hasn't resurfaced.
posted by mikel at 10:47 AM on March 7, 2006


« Older What is a package shipping method that is...   |   Is giving head supposed to be arousing to the... Newer »
This thread is closed to new comments.