 |
 |
what is this "python" eating up 97% of my CPU under activity monitor?
|
 |
|
 |
|
Senior User
Join Date: Aug 2002
Status:
Offline
|
|
was wondering if anyone know what this is? Its constantly using around 95 - 100% of my CPU...
its under OS X 10.4.1, not sure if i remember seeing this being there before...
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Are you running BitTorrent? Python is a programming language, BitTorrent being the most popular app I know of that uses it.
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jan 2003
Location: 127.0.0.1
Status:
Offline
|
|
Do you have the TV tracker widget?
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Nov 1999
Status:
Offline
|
|
Python is a programming language which comes with OSX. Like Java, it compiles to a form of bytecode which is then interpreted with a program that has the same name as the programming language, and that is the python process you're seeing. Although it tends to run a bit slower than Java, it starts up much more quickly, and Apple uses it for a few system functions. For example, when you fax images from the Print dialog, a lot of the code to handle this is written in Python. However, this is not the most common way to get a Python process running on your machine; that honor goes to BitTorrent.
Most BitTorrent clients are written in Python, because that's what the official client uses. On Macs, both the official client and Tomato Torrent use a bridge called PyObjC to write Cocoa apps in Python instead of Objective-C. It's very unusual for BitTorrent clients to use up that much CPU, however.
I haven't encountered this "TV Tracker" widget that alpha mentions. From what I can tell from the Website, though, it does seem to use Python, and therefore it probably uses PyObjC too. This said, would it really use that much CPU time just parsing an HTML page?
|
|
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Nov 2001
Location: fourth sector
Status:
Offline
|
|
Had the same problem. When the TV Tracker widget tries to get information from the internet and fails (cause you are not connected, for example) python seems to stall.
nexus5.
|
|
|
| |
|
|
|
 |
|
 |
|
Posting Junkie
Join Date: Jun 2003
Location: Dangling something in the water… of the Arabian Sea
Status:
Offline
|
|
If TV Tracker is stuck (no internet access), then python uses zero % CPU on my machine. If TV Tracker is downloading info, python never goes above 20% on my 1 GHz TiBook. Usually much less than 10% actually.
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Mar 2002
Location: Smallish town in Ohio
Status:
Offline
|
|
Originally Posted by Millennium
Python is a programming language which comes with OSX. Like Java, it compiles to a form of bytecode which is then interpreted with a program that has the same name as the programming language, and that is the python process you're seeing. Although it tends to run a bit slower than Java, it starts up much more quickly, and Apple uses it for a few system functions. For example, when you fax images from the Print dialog, a lot of the code to handle this is written in Python. However, this is not the most common way to get a Python process running on your machine; that honor goes to BitTorrent.
How do you know all this? 
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Nov 2003
Status:
Offline
|
|
Originally Posted by Millennium
I haven't encountered this "TV Tracker" widget that alpha mentions. From what I can tell from the Website, though, it does seem to use Python, and therefore it probably uses PyObjC too. This said, would it really use that much CPU time just parsing an HTML page?
TV Tracker doesn't use PyObjC, but rather includes uncompiled python programs inside its widget bundle. The widget then makes system calls (via widget.system) from its JavaScript to run these various subprograms (e.g. "/usr/bin/python main.py --max") for different functions (getting a channel listing for a zip code, populating the channel guide, etc.).
So anyway, that's why these TV Tracker Python processes are so CPU intensive: they're using interpreted code instead of compiled code. And when one of the system processeses gets "detached" from the widget's client dashboard process (which apparently can happen), it can sit around and chew up a lot of time.
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
But isn't Python code compiled when it's interpreted? The fact that it's interpreted should only matter when it's being loaded.
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Nov 1999
Status:
Offline
|
|
Originally Posted by macintologist
How do you know all this?
I'm a bit of a Python freak, I'll admit. I started out learning it for work, but it's become my favorite language. One of these days I'll work up the guts to actually code something worthy of unleashing on an unsuspecting public... um, I mean releasing. Yeah, that's it.
As for Chuckit's question, uncompiled Python source files (.py) are usually compiled the first time they're run (.pyc), and the .pyc files are then executed. Because of that, this shouldn't be an issue after the first time the widget fetches HTML.
I admit, I'm a little curious about the widget's design. I know that widgets can include Cocoa "custom code plug-ins", and the API doesn't look like anything that PyObjC wouldn't be able to handle. Why not roll the Python code into a plug-in and parse the HTML that way? This should eliminate the detachment issues, and it may even run a bit faster. The downside is that it would use a bit more RAM, since the plug-in would be constantly loaded rather than called occasionally, but I don't think this would be that much of a problem.
|
|
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jul 2004
Location: Canada
Status:
Offline
|
|
I was bitten by this bug. The 1.5 version of the TV tracker fixes this bug.
|
|
--
Aristotle
24" iMac 2.8Ghz 4GB RAM, 320GB HD; 64GB iPhone 4 S⃣
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|