5

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?

Gareth
  • 19,080
barrymac
  • 775
  • 3
  • 9
  • 21

3 Answers3

5

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. . .

surfasb
  • 22,896
2

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.

Synetech
  • 69,547
2

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.

Abraxas
  • 1,265