views:

229

answers:

6

Hi,

happens to me occasionally:

I start my program in visual studio and due to some bug my program goes into 100% cpu usage and basically freezes windows completely.

Only by utter patience requesting the task manager (takes forever to come up and paint itself) I can kill my process.

Do others encounter this too sometimes? Is there a clever trick to get this process down (other than pulling the plug and possible ruining files on the HD)? It now takes 5-10 minutes to kill it properly if the task manager is not accidentally present and I have to request this first

R

p.s. weird that a 'multitasking os' can still allow processes to eat up so much time that nothing else can be done anymore. My program doesn't even bump up it's thread priorities or anything

A: 

For what it's worth, I've never see this on either XP 64 or Vista 64, developing C++ apps in Visual Studio. Perhaps an OS upgrade is in order?

Edit: I use Process Explorer as a replacement Task Manager - it wouldn't surprise me if it did a better job of appearing in good time even when there's a rogue process running. And you can use it to boost its own priority.

RichieHindle
unfortunately it just happened to me on windows 7 64bit.
Toad
thanks for the the process explorer tip... I've used other sysinternals tools in the past. If this is half as good as their other tools, it should probably already be 45 times better than the default task manager
Toad
A: 

I usually hit ctrl-alt-delete start the task manager sort by cpu find the offending process and right click and end the process..

task manager usually has enough priority to do this although it may be slow.

chrishawn
A: 
Martin Beckett
hahaha,... I've considered it some times ;^)
Toad
A: 

I generally don't see anything like this happen strictly as a function of an app that's eating 100% CPU. As part of stability / performance testing, I've gotten apps to cause Windows to get very slow, but this is usually done by writing heavily threaded apps (thus causing the O/S scheduler to thrash), or by writing apps that consume all available system memory or resources (much more impactful to the GUI apps than simply one thread that consumes its full share of processor time during its slices).

Nadim
I just found the problem: a function recursing endlessly. Apparently that's all it takes to freeze your OS to bullet time
Toad
Recursing endlessly tends to eat up memory. Did you look at the memory footprint of the app when it went into "runaway" mode? Again, memory eaters tend to hurt the system far more than CPU eaters, at least in my experience.
Nadim
The question is, why does the explorer, task manager, etc... not remain locked in memory on a machine with gigs of memory? I think Windows should mark these critical UI and maintenance processes as non-swappable. Also, if the GUI could redraw itself without paging in the entire app, that would help. Someday? Maybe with a backing store?
Joe Koberg
joe: my thoughts exactly... too bad windows 7 didn't fix it
Toad
A: 

Check out Process Lasso

"Process Lasso is a unique new technology that will, amongst other things, improve your PC's responsiveness and stability. Windows, by design, allows programs to monopolize your CPU without restraint -- leading to freezes and hangs. Process Lasso's ProBalance (Process Balance) technology intelligently adjusts the priority of running programs so that badly behaved or overly active processes won't interfere with your ability to use the computer!"

http://www.bitsum.com/prolasso.php

I am not affiliated with Bitsum, just a user of their product, and it helps me solve this type of problems.

Lior Kogan
excellent tip! thanks
Toad
A: 

You say you get this behavior under Visual Studio? VS has a "Pause" button...

Mike Dunlavey