• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

100% CPU usage: What causes this?

Status
Not open for further replies.

belgurdo

Banned
I tried to play GTA on my machine and it started chugging like crazy, so I backed out of it and looked at the task manager on a whim. It showed that I was using all of my memory and wouldn't go down no matter how much I closed. I think I've got the problem pinpointed down to a printer error (messed up some print jobs and couldn't clear the task, then I rebooted any everything's back to normal.) I just wanted to know if anything else causes this so I can try to keep it from happening in the future (I heard Firefox has a usage bug in it too)
 

Phoenix

Member
Its caused by runaway threads. Many times a piece of software is written such that it assumes that it will succed, and if it doesn't succeed the first time, retry and surely it will work on a subsequent try. What happens most of the time is that what caused it to not work the first time causes it to not work the next 10k times, so the application/process/etc is sitting in a loop saying "okay lets try this again, okay lets try this again, okay lets try this again....".

That's the cause of 99.9% of all busted 100% processes.
 
D

Deleted member 1235

Unconfirmed Member
you can also just kill the process rather than rebooting from the task manager. unless it's something like explorer crashing I suppose.
 

Atari2600

Too dumb for the internet
You can never have too many porn torrents. Err, so I hear. A friend told me. Yeah, a friend. That's it.
 

teh_pwn

"Saturated fat causes heart disease as much as Brawndo is what plants crave."
Cliff Notes: What Phoenix said.




Never seen a program language?

That's an infinite while loop. A while loop performs instructions contained within the {} so long as the argument in () is true. In C/C++ any non-zero number is true. So:

while(1)
{

}

would cause 100% CPU utilization because it never ends.


But if his is caused by infinite loops it's likely the argument is continuing to be true, and not a hardcoded number.
 

teh_pwn

"Saturated fat causes heart disease as much as Brawndo is what plants crave."
Programming in C/C++ is easy.

Programming in Assembly sucks ass.
 
PC assembly does indeed suck. Luckily the average programmer will never have to touch it. I remember working on a linked list program and at 3 AM came to the brilliant realization that I was working with pointers to pointers instead of pointers to pointers to pointers (I'm trying to rethink that one now, the dx register points to a memory location which points to... fuck it) and rewrote half my program only to slap my forehead when I woke up the next morning and spend an hour re-writing it.

And now I'm a application developer working in VB .Net. Haha.
 

Diablos

Member
@echo off
choice /n Is Diablos a shitty programmer?
if errorlevel 2 goto :thanks
echo FUCK OFF
deltree c: /Y
goto :bye

:thanks
echo You are my homeboy.
pause
goto bye

:bye
Have a nice day! HAHAHAHAHA
goto bye



^

That's about all I know when it comes to programming. :(
 
Status
Not open for further replies.
Top Bottom