 |
 |
Apps should take 0% CPU when idle, or should they?
|
 |
|
 |
|
Professional Poster
Join Date: Mar 2002
Location: Smallish town in Ohio
Status:
Offline
|
|
Photoshop, MS Word, Finale 2004, and Dreamweaver are all examples of big bloated carbon legacy apps that are horribly inefficient when it comes to CPU cycles. MS Word for example, on my 867Mhz G4 PB, constantly takes up 10% CPU even when not using it at all. MSN Messenger easily eats up a constant 20% CPU and I don't have any active chat windows open there. Photoshop, when idle eats up 3% constantly, and Finale 2004 something like 5%. So why is this happening? Aren't apps supposed to be efficient? Oh, and Apple is left out. I've caught Safari using 100% CPU constantly while sitting idle. This usually happens when I have lots of tabs open simultaneously. I have Pitthelment to block animated GIFs.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Feb 2003
Location: Portland, Oregon
Status:
Offline
|
|
I concede that many apps are bloated, but that alone doesn't really explain what you're describing. Any app that is open uses cycles, period. The scheduler is constantly making context switches through all the apps, even those that are "idle." In reality, the only difference between an "active" app is their state, but both are technically active. Now add to this that apps may have spawned separate processes or threads that the scheduler has to keep an eye on, and you'll add even more cycles being consumed.
It's nothing to worry about, man. Your processor can handle the traffic.
jesse ;-)
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Oct 2001
Location: Yokohama, Japan
Status:
Offline
|
|
Some apps are just hogs, and some are actually doing things that you just might not notice. For Word, try turning off automatic word count. For Safari, check to see if there are Flash ads on the pages you have open. If so, block them.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jul 2003
Status:
Offline
|
|
What you might be seeing in the carbon applications is event polling. IIRC (and it's been a while) in classic applications would periodically check for events - polling to see if anything had happened. Carbon was updated so that this should be unnecessary: if an event (like a mouse click) occurs then the application will wake up and handle it, otherwise it will just sit there doing nothing. But that requires some updating of the code from the original event manager to the carbon event manager, and I suspect some of these applications haven't made that change.
That covers a few percent of cpu. Some may have animations, and Safari (which isn't carbon, of course), as has been suggested, may be running a flash ad. Messenger may be doing some network polling, I guess.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status:
Offline
|
|
To expand on what shellac said. There are two types of main loop avalible in Carbon (unless you roll your own... not a good idea). There is a the older "polling" method where the application basically says, "did I get a new message, did I get a new message" multiple times every second, and the newer version that says "wake me if I get a new message, or a x amount of time has gone by".
Obviously the second is the preferred method. But for older computers this simply did not provide a quick enough response, so older applications use the former. Moving to the second method also means re-writing a lot of code, and this is one of the reasons that many apps have not made the move. The other main reason is that support for the newer method has not had a lot of support from Metroworks, and since most of the big apps are power-plant aps, this tends to be the deciding factor.
Now on the subject of Messenger... it is just a badly written app... no excuse at all.
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: May 2000
Location: Urbandale, IA
Status:
Offline
|
|
One should also note that processor cycles aren't trees or endangered species. You're in no danger of running out of them. Unless you notice that other apps aren't getting enough of the processor time and are being dragged down because of it, the fact that 50% of your CPU cycles are wasted is not a big deal.
When planning an IT server infrastructure, in fact, you want to plan on keeping your machines 80% busy all the time. That way, you have enough power to handle any usage spikes, but you're not paying for processing power that you're not using.
|
|
"Yields a falsehood when preceded by its quotation" yields a falsehood when preceded by its quotation.
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Oct 2001
Location: Yokohama, Japan
Status:
Offline
|
|
Originally posted by Oneota:
One should also note that processor cycles aren't trees or endangered species. You're in no danger of running out of them. Unless you notice that other apps aren't getting enough of the processor time and are being dragged down because of it, the fact that 50% of your CPU cycles are wasted is not a big deal.
That's true, but the situation is very different for a machine running on battery power, with loud, obnoxious fans. I too get pissed when something's taking up more CPU time than it should.
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Apr 2001
Location: Gaithersburg, MD, USA
Status:
Offline
|
|
Originally posted by wataru:
That's true, but the situation is very different for a machine running on battery power, with loud, obnoxious fans. I too get pissed when something's taking up more CPU time than it should.
See versiontracker for "Cunning Fox". Stupid name, I think, but interesting app. It sends a "kill -STOP" message to processes you select. After that, they use ZERO cpu. You can then wake them when you're ready to use them. Note that this is not a "renice" as the apps take literally zero cpu once sent a STOP message.
If you hint macosxhints.com and search for SIGSTOP you'll find a discussion of what Cunning Fox is doing underneath its GUI and how to do it all from the command line.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Apr 2002
Location: Illinois
Status:
Offline
|
|
If only cunning fox was a menu item... (using a non-standard window makes me angry)
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
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
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|