Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Windows 7 seems to be a bit overzealous in closing programs where it thinks the program has stopped responding. Some things just take a long long time, and I have the feeling that it should give things a bit longer before deciding that they are not working anymore.

Can anyone enlighten me as to the criteria that it uses to decide if a program has frozen?

share|improve this question
    
Title does not match question. Consider revising one or both for accuracy. ;-) –  Synetech Jul 18 '11 at 0:38
    
Done! Any other suggestions? –  surfasb Jul 18 '11 at 1:39
    
That’s not what I meant. The title is asking how to prevent Windows from doing something while the question is asking for information about how something works. –  Synetech Jul 18 '11 at 1:46

3 Answers 3

up vote 5 down vote accepted

There are several criteria. In general, unhandled exceptions are the top killer. There are other errors, but they get pretty technical.

Two, an application becomes unresponsive if messages dispatched to it are not retrieved. Windows attaches a timer to messages to each application. If it is not handled, then that's when you get the unresponsive message.

Three, applications can also explicitly tell Windows to kill the application process give certain non fatal errors. Often this is to prevent data corruption.

Which program is it that hangs?

edit:

Aparently, there is a way to turn this off. By coincidence, I was reading the perfmon team blog and ran into this article. It give steps to explicitly turn off "ghosting" for an application. I'll cut and paste the steps also.

To download the Application Compatibility Toolkit, visit the following Microsoft Web site:

http://msdn2.microsoft.com/en-us/library/aa286552.aspx

To create a custom Application Compatibility database:

  1. Install and run the Compatibility Administrator Tool.

  2. Right-click Custom Database, and then click New.

  3. Right-click the new database, and then click Rename.

  4. Type noghost as the name of the database. (You can name this whatever you want.)

  5. Right-click New Database, click Create New, and then click Application Fix. Type the name of the program to be fixed.

  6. Type the name of the program manufacturer.

  7. Locate and then select the appropriate program (.exe) file.

  8. Click Next.

  9. In the Compatibility Modes window, click None, and then click Next.

  10. In the Compatibility Fixes list, click NoGhost.

  11. Click either Test Run or Finish. Clicking Test Run starts the program with the application compatibility setting. Clicking Finish adds the compatibility fix to your database.

  12. On the File menu, click Save to save the database. Or, copy the database to the C:\Windows\AppPatch folder.

  13. Right-click the database, and then click Install. Or, run the sdbinst c:\windows\apppatch\noghost.sdb -q command to install the database.

I verified the steps myself. . .

share|improve this answer
    
I think this is the most helpful answer in a way. I verified this by leaving the program untouched (imgSeek) for the whole night and sure enough it was not force closed and was still busy in the momrning. imgSeek is a content based image search tool. It may have some scaling issue as I'm running it on a quite large collection of about 20k images. –  barrymac Jul 18 '11 at 15:43
    
Yeah, Win7 wanted to help confused users out. But if you know it ain't hung, then I'd ignore the dialog box. So you went with imgSeek. Let me know how it works out. I've been playing with Emir & Caliph. Steep learning curve . . . –  surfasb Jul 18 '11 at 18:46
    
I ran across a solution that might help. I editted my answer. –  surfasb Jul 18 '11 at 18:59
1  
@barrymac, you may want to contact the authors of imgSeek and tell them about the problem. They may want to (read should) change it so that the processing code is done in a separate thread so that the interface is not blocked. Not only does that avoid the unresponsiveness, but it also has the benefit of making it easy to implement a Pause/Cancel option. –  Synetech Jul 19 '11 at 0:11
    
In my case the program went longer before being declared nonresponsive but it still happened. It's a game, the developer is more interested in their next game than fixing problems with the old one. –  Loren Pechtel Jan 7 at 23:45

You can change the timeout period required for Windows to consider an application (or service) as being unresponsive by changing the WaitToKillAppTimeout entry (WaitToKillServiceTimeout for services). This is a per-user setting.

The default is 20,000 milliseconds (20 seconds), so you can try setting it to 30,000 or whatever. Also, you should be able to click Cancel on the End Task dialog to give it more time on demand.

Other related settings that you can change include HungAppTimeout, and AutoEndTasks.

share|improve this answer
    
Yeah, it looks like these are all timeouts for user initiated behavior. WaitToKill is for logoffs. HungAppTimeout is for Taskman Kills. I think the OP was refering to when Windows kills unreponsive UIs, which is 5 seconds. AFAIK, there is no way to change the 5 seconds. –  surfasb Jul 18 '11 at 1:38
    
It sounds like Barry is talking about the End Task dialog, in which case, the aforementioned entries are what he needs. –  Synetech Jul 18 '11 at 1:47
    
"Windows 7 seems to be a bit overzealous in closing programs where it thinks the program has stopped responding." The End Task dialog shows up if you try to kill a task through TaskMan. I'm pretty sure Barry is refering to the unresponsive dialog. i.msdn.microsoft.com/dynimg/IC292438.gif –  surfasb Jul 18 '11 at 9:58
    
Tomato, tomato. –  Synetech Jul 18 '11 at 10:41
    
This is very useful information but I don't think it will solve my particular issue. Thank you –  barrymac Jul 18 '11 at 15:44

Windows 7 doesn't make any attempt to close a program that is unresponsive before it reaches the timeout unless you click on it or attempt to perform another task before it has finished with the one it is completing. You may have better luck if you simply wait till the program has finished before clicking on it to start something else.

Changing the timeout will not change that behavior - it only controls how long Windows itself waits, not the user.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.