953,874 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Near 100% CPU Usage

Firefox has always been my main browser, and I've always visited Daniweb on a daily basis. However, today, I opened up Daniweb (under Ubuntu Linux 7.10, Firefox 2), and my fan started whirring like crazy.

I opened up a terminal and entered "top" as a command, and saw that Firefox was using between 94%-96% of my CPU's power. I closed the Daniweb tab, and the fan stopped, and the CPU dropped down to 1%-2%.

Is this a problem with the flash ads on the homepage, or what?

You might want to look into this, because it's actually happened a few times now, and it crippling my ability to view this page without running up my CPU.

linux
Posting Shark
933 posts since Aug 2006
Reputation Points: 118
Solved Threads: 30
 

I reckon it is...

You can right click the flash ads and choose LOW QUALITY and it wont be as bad... (I have done that before)

Good luck!

The Dude
Nearly a Senior Poster
3,485 posts since Dec 2005
Reputation Points: 1,054
Solved Threads: 31
 

I reckon it is...

You can right click the flash ads and choose LOW QUALITY and it wont be as bad... (I have done that before)

Good luck!


You've missed the point. If he didn't want the ads, he could just as easily use an adblocker and never see them again. The point is why the ads are taking up 100% of his CPU in the first place.

John A
Vampirical Lurker
Team Colleague
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
 

IMAO Flash ads should be banned. They are annoying resource hogs. And Flash sites too. Flash should be used to enhance a site, not be the site.

WaltP
Posting Sage w/ dash of thyme
Moderator
10,470 posts since May 2006
Reputation Points: 3,342
Solved Threads: 937
 
You've missed the point.

Im sorry Joe maybe i have.......

The Dude
Nearly a Senior Poster
3,485 posts since Dec 2005
Reputation Points: 1,054
Solved Threads: 31
 
IMAO Flash ads should be banned. They are annoying resource hogs.


It'll never happen. It's actually kind of sad how Flash is driving the advertising industry online...

John A
Vampirical Lurker
Team Colleague
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
 

This is the problem I was reporting last summer.

What does the fan on the back of the computer have to do with CPU usage???

It doesn't get hotter with increased CPU use. It just sits there doing a repeating loop when it has nothing else to do. The same heat is produced either way.

Now the disk drive is a different story. It will produce more heat with increased use.

MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
 

>What does the fan on the back of the computer have to do with CPU usage???
It's quite simple. When the CPU usage is high, it generates lots of heat. When there's lots of heat, the fans kick in.

John A
Vampirical Lurker
Team Colleague
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
 
>What does the fan on the back of the computer have to do with CPU usage??? It's quite simple. When the CPU usage is high, it generates lots of heat. When there's lots of heat, the fans kick in.

That is absolutely STUPID.

A CPU doesn't generate any more heat when it is being used more.

It's not like an auto engine. The same parts in it are always powered up and operating at the same speed, whether it is busy or idling. The parts are still being used just as much when the CPU is not "busy." They sit there wasting time with thumbtwiddling operations in Windows at the same high speed, waiting for the user to do something. And the RAM is also running at the same speed.

Disk drives and CD burners are the only parts inside the computer that produce substantially more heat when they are used. And some video cards produce slightly more heat when the image is complex.

The only time a CPU "slows down" is when a laptop goes into power-saving sleep mode. And of course, it stops when you turn off the power.

The factors that most determine how often the fans run are the room temperature and how open the space around the computer is.

Also, there should be quite a delay between any increase in heat generation and the time the fan comes on, because it takes time for the heat to get to the heat sensor.

You may be thinking of the kludges people made in the 1970s to speed up CPUs by changing the clock speed during certain operations. I used to have one of those. It needed extra cooling in the high speed mode, and could not do certain operations in high speed mode. But such tricks are not used anymore.

MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
 

That's funny... If I compile a big program or run a game my fan also kicks in.

Maybe my laptop is just absolutely STUPID?

Niek

Nick Evan
Not a Llama
Moderator
10,112 posts since Oct 2006
Reputation Points: 4,142
Solved Threads: 403
 

Yes, computers are stupid, as MidiMagic proves. He's completely right, but the computers don't know that, so they turn the fan on when they shouldn't. We need to teach the computers that they should not generate additional heat when they are actually working rather than sitting idle. They need to follow MidiMagic's rules. He's obviously studied the phenomena.

I'll call Intel later today.

WaltP
Posting Sage w/ dash of thyme
Moderator
10,470 posts since May 2006
Reputation Points: 3,342
Solved Threads: 937
 

That's funny... If I compile a big program or run a game my fan also kicks in.

Maybe my laptop is just absolutely STUPID?

Niek

You are using the hard disk drive more. That does produce more heat.

Also, you probably notice the fan more when you are waiting for something to finish, than when you are busy doing something thought-intensive.

In every machine I have ever used, the fan either runs on high all the time, or cycles between high and low on a periodic basis, depending on the heat produced. During exams, when everyone has to be quiet, I hear the various computers cycling between high and low fan in a seemingly random pattern. If starting the exam produced more heat, they should all go to high at about the same time.

There is one other possibility, and that is a smart program or hardware in some brands of computers is figuring out when the disk drive is about to be used more, and turning up the fan in anticipation.

MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
 

Processors generate heat. It is a very simple concept, with the newer processors, they are more 'energy efficient' which means they *will* perform less work, and thus generate less heat when you are doing nothing on the computer.

Unless you are running one of the original Pentium series processors, you are wrong.

If you are going to argue, go read the Intel Whitepages on how their processors work, and come back.

The disk drive does produce heat, unfortunately CPU (and newer chasis fans) are not designed for the hard disk drive, and if you don't believe me, open up a server, the fans are pulling air from the front, running it over the CPU heat sinks and out the back. Most of the time they are tunneled through plastic, so the air ONLY hits the CPUs, and RAM.

http://www.2cpu.com/gallery/sm-5015-UR/5015M_UR

If you *really* don't believe me, I can sit next to a daniweb server (which doesn't use any disk usage at all), force the CPU to spike, and the fans will go from 1k RPM to 15k RPM instantly.

blud
Linux Reject
Staff Writer
830 posts since Apr 2004
Reputation Points: 154
Solved Threads: 20
 

I had Experience with Firefox 2, It uses lot of bandwidth in background until when no site is opened...Switch to version 3 (Beta 1) and choose yourself what to load or what not to under Options.

thunderstorm98
Veteran Poster
1,117 posts since Nov 2006
Reputation Points: 97
Solved Threads: 20
 
I had Experience with Firefox 2, It uses lot of bandwidth in background until when no site is opened...Switch to version 3 (Beta 1) and choose yourself what to load or what not to under Options.

[memory jog]I was recently fixin' up some memory issues with one of my FF installs are I ran across something like this . Originally I was trying to find and fix problematic extensions , but my main workaround on that setup was the Config.trim_on_minimize . FWIW

Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
 

Firefox 3 beta doesn't have the CPU bug, but it has many others

jbennet
Moderator
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,820
Solved Threads: 599
 
Processors generate heat. It is a very simple concept, with the newer processors, they are more 'energy efficient' which means they *will* perform less work, and thus generate less heat when you are doing nothing on the computer.

OK, so how does the CPU know whether the program it is running is doing a lot of work, or is just sitting there going through some status-checking loops? Does Windows tell it when it is doing work? It can't find out by analyzing the program, because a hardworking program could look a lot like an idling program.

Next, how does whatever device determines how busy the computer will be know that in advance? It can't telll what the user is going to do.

How does the CPU save power? Does the clock speed change? Does a second processor of a dual processor shut down? Those are the only power-saving methods I can think of that don't destroy data.

The only articles I could find on the web say that some laptops slow the CPU clock to half speed when no windows are executing code. And I found a few companies using overclocking (running the CPU beyond spec speed) for short periods.

And compared to the amount of power an average house uses, reducing CPU consumption is mousemilking.

MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
 

In a data center environment, CPUs that are energystar compliant are very important.

The Intel white papers on an Intel Core2Duo state that the processor runs at only 30C when idle, and 55C when fully utilized, computers are very complicated machines, which include several pieces of equipment that work together to perform very complicated tasks. The motherboard will tell the CPU when it is about to recieve data from the I/O devices and/or PCI Bus, which then allows it to start speeding up. At the same time, the motherboard can detect how much work the CPU is doing, and control the speed of the fans in the system.

Your CPU is responsible for almost 30% of your computers power consumption, so from 30% to 10% adds up when you are talking about 20-50,000 systems.


In a much smaller area, my computer room has 5PCs, if I let the PC's idle and not do any work, the room sits at 76F, if I max out the CPU's running benchmarks for 20 minutes, the room is at 82F. (Real life test, I just did it)

blud
Linux Reject
Staff Writer
830 posts since Apr 2004
Reputation Points: 154
Solved Threads: 20
 
OK, so how does the CPU know whether the program it is running is doing a lot of work, or is just sitting there going through some status-checking loops? Does Windows tell it when it is doing work? It can't find out by analyzing the program, because a hardworking program could look a lot like an idling program.

When there are no instructions to run, the CPU is stopped (with the appropriate CPU instruction) and waits for an interrupt. The kernel does this. Programs don't handle events by busy-waiting, as you surmise, or if they do, they spend some time sleeping to avoid overusing the CPU. (If you ever wrote a program that busy-waited, you would see your CPU use rise to almost 100% and see your temperature rise, too.)

sarehu
Posting Whiz in Training
289 posts since Oct 2007
Reputation Points: 98
Solved Threads: 22
 

That explains why read-modify-write scientific operations based on real world events don't work anymore.

Kill the environmentalists who thought this up. They killed off a whole branch of science.

MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You