PDA

View Full Version : Tendency of Classic to capture high %CPU


lidar_researcher
01-29-2002, 07:40 PM
Hey Guys, I have a somewhat off-the-wall question/issue.

When ever a classic app is in use the classic environment (i.e., "TruBlueEnv" if you look at the output from Top) tends to get a very high percentage of the CPU when it is the foremost window (upwards of 80-95%)! In the specific case of MatLab 5.2 this % runs in the neighborhood of 93-96...even when I'm not actively doing anything with the app (i.e., inputting data, running a macro etc)! Although this isn't a major problem it does bug me since I have a TiBk/667 and very shortly after launching MatLab (and other classic apps) the PB's loud fan comes on (and, of course, the underside of the PB gets quite hot). Yes, one can click on a true OSX window so that the classic environment is no longer in the forefront and this does reduce the %CPU to nearly 0, but this is far from ideal. So (now I'm finally getting to the question) is there a way to scale the amount (%) of the CPU that the classic environment can get? There may not be, but I figured it couldn't hurt to ask.

TIA

L_R

mervTormel
01-29-2002, 10:47 PM
lidar,

you could adjust the scheduling priority of the TruBlueEnvironment (classic) process via several ways, both GUI and shell, but i don't recommend fiddling too much with the scheduling priority of system tasks without considering the consequences and thorough testing.

giving a process a very high priority, or giving a critical system task, like the kernel_task, a very low priority, may interfere with the operating system's own operation.

nice is the term used to designate the priority schedule of a process. the OSX default process is run at 0 nice. default classic is run at a nice value of -10 (a higher prio) and there may be a good reason for that, like, most optimum overall reasonable performance observed by the apple engineers(?)

that said, there are several GUI renice utilities; Process Wizard comes to mind as the slickest implementation of summarizing all your processes with sliders.

and there's good old CLI command, renice.

so, you could find the process ID <pid> of classic and renice it to zero

try:

% ps ax | grep "[b]lue"
<pid> ?? R 6:28.80 /System/Library/Core.../Resources/TruBlueEnvironment

% renice 0 <pid>
<pid>: old priority -10, new priority 0


you'll need to sudo renice to pop its prio back up to -10, if you need to.

give that a try and let us know your results.

lidar_researcher
01-30-2002, 06:57 AM
mervTormel-

Thanks for the suggestion. And for the detailed background, greatly appreciated that.

Have reniced the TrueBluEnv to 0, with absolutely no effect on the %CPU. So there may be no (easy) way to do this, but at we gave it a try.

Again, thx.

Lidar

Craig R. Arko
01-30-2002, 10:39 AM
Originally posted by mervTormel

nice is the term used to designate the priority schedule of a process. the OSX default process is run at 0 nice. default classic is run at a nice value of -10 (a higher prio) and there may be a good reason for that, like, most optimum overall reasonable performance observed by the apple engineers(?)


Are you sure about that? For me Classic always has run with a default nice value of 0, as do almost all other processes. Which means Lidar should try setting it to a positive value, like +10.

And yes, Process Wizard has become a standard addon I install on all machines. It's great!!

mervTormel
01-30-2002, 11:04 AM
Originally posted by Craig R. Arko


Are you sure about that? For me Classic always has run with a default nice value of 0, as do almost all other processes. Which means Lidar should try setting it to a positive value, like +10.

And yes, Process Wizard has become a standard addon I install on all machines. It's great!!

apologies, people. just launched classic and it is at nice zero.

thanks craig.

can't figure out how it appeared to be a default of -10 yesterday (fat fingers, lack of thorough checking)

lidar, you may not see an immediate result of renice'ing something, but under a load, it may be more evident.

be sure to check the results of your renice with

% ps -axcl | egrep "PID|Blue"
UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TT TIME COMMAND
501 1786 1 0 53 10 1106324 38060 - RN ?? 3:13.96 TruBlueEnvironme

lidar_researcher
01-30-2002, 11:31 AM
Hi Guys-

Just tried that....reniced to +15. Unfortunately, the %CPU remains high...even when I'm doing nothing with the App.

Thanks a ton for you help.

lidar

Aet
02-16-2003, 06:07 PM
I've actually the opposite problem - there is a Classic application that, when running, I want to have very high priority, no matter what I'm doing and where. Ie, its dropping off to nearly 0% CPU when switching out of Classic into an OS X window is not wanted. Renicing it sounds possible, but I have my doubts it would help. Something else is going on in the OS... is there any way around it?