Automatically Restart Crashed Or Hanged Applications

Don’t you hate it when programs hang or crash? I find it especially annoying when a background application like an IM client or a bandwidth monitor silently crashes – sometimes I only notice the problem hours later when I’ve already missed a bunch of messages. I’m sure you’ve encountered a few “Not responding” errors and some irritatingly crash-prone applications yourself.

If you have an unstable program that you absolutely need to run at all times, but don’t want to waste your time monitoring and manually restarting it every time it croaks, I might have something interesting for you.

Restart on Crash is an monitoring tool that will watch the applications that you specify and automatically relaunch any program that hangs or crashes. You can add any number of applications to monitor, enable/disable them individually and edit the command line that will be used to restart an application.

Restart on Crash doesn’t require installation and stores all it’s configuration data in a “settings.ini” file in the program’s folder, so it’s portable. It should be compatible with most NT-based Windows versions.

Download Restart on Crash (1.4 MB)

Screenshots & Documentation

Main application window

The main window

  • To add a new application to monitor, click the “Add” button or press the Ins key.
  • To delete on or more applications from the list, select them and click “Delete” or press Del.
  • To edit the per-application configuration, double-click the corresponding row. This will open the editing dialog (see below).
  • You can also access the RoC configuration by clicking “Settings” and view the activity log by clicking “Show Log”. The log contains information about crashed/hanged applications, executed commands, and so on.
Editing the monitor settings for an application

Editing the monitor settings for an application

Well, this one should be pretty self-explanatory 🙂 One detail to keep in mind is that enabling the “It isn’t running” option will make Restart On Crash treat the application as if it has crashed even if you have purposefully it closed it. You can get around this by disabling the monitoring of the application before you close it.

The configuration dialog. Yes, that's it.

The configuration dialog. Yes, that’s it.

“Grace period” is how long Restart on Crash will wait before trying to terminate/restart an application that it has just terminated/restarted. This is intended to prevent a scenario where RoC kills a hanged program, restarts it, decides it has hanged again (e.g. if the program is non-responsive while starting up) and wrongfully terminates it again.

Known Issues

  • If you configure RoC to automatically kill a hanged application, it will terminate all instances of that application when doing so. This may be fixed eventually.
Related posts :

454 Responses to “Automatically Restart Crashed Or Hanged Applications”

  1. xucl says:

    Thanks for this utility. It’s very handy; I want to monitor two java.exe. How to distinguish them?

  2. Jānis Elsts says:

    Unfortunately, that’s currently not possible. RoC treats all processes that have the same .exe file as the same application.

  3. Enova says:

    Looking for such a tool, but all that tools have same bug: they can’t detect frozen apps even if there’s “this app is not working, click CLOSE button to close an app” frame. :-/

  4. Jānis Elsts says:

    This application is supposed to detect those pop-ups, but I’m not sure how effective it is. I’ve only tested that feature on some versions of Windows 10.

  5. Enova says:

    Seems like that’s not working, or not always working.
    https://i.imgur.com/dQiUTjP.png

  6. Joseph Fellows-McMurray says:

    I’m wondering if there’s a way to save the program if the PC restart?

  7. Jānis Elsts says:

    @Enova:
    Thank you for the screenshot. Do you know a way I could reliably reproduce that error on my own system? If I can analyse it properly, I might be able to find a way to make RoC detect problems like that.

    @Joseph Fellows-McMurray:
    Do you mean that you want the monitored program to start automatically when the PC restarts? I think you could do that by enabling the “Run RoC when Windows starts” option in RoC settings. This way Windows will automatically start RoC when the PC restarts and RoC will then start your program.

    Alternatively, you could add the program itself to Windows startup apps.

  8. Enova says:

    @Janis
    To be fair, idk how to reproduce. That happens for program that is freezed, but not crashed.

  9. Arsen says:

    Hi Janis,

    First of all I would like to thank you for such a nice program.
    I have couple ideas for you, see if you can realize them!
    Is it possible to add “Duration” column between “Application” and “Status” columns, so it will be possible to know how long is already running each application?
    The other idea is to kill hanged application if it is “eating” CPU resources more than 95 or 97%. Would be nice if this parameter(CPU usage) is also configurable.

    Thanks in advance.

  10. Brandon says:

    Is it possible to re-start the program window maximized? I tried adding Window=max, /start /max “”, –new-window/max to the command line, but nothing appears to be working to start it back up as max.

  11. Jānis Elsts says:

    I think “start /max command-here” could work, but you might need to put it in a .bat file and then use the path to that file as the command to execute.

  12. Arsen says:

    Hi Janis,

    Could you please answer to my questions also, which are mentioned above?

    Thanks 🙂

  13. Jānis Elsts says:

    @Arsen: I’ve seen your feature suggestions and added them to my notes. Adding a “Duration” or “Runtime” column seems feasible; I might do that in a future release.

    As for killing applications that have very high CPU usage, that looks less likely. It would be complicated to make it work reliably.

  14. Arsen says:

    Hi Janis,

    Thank you for your response.
    Regarding killing/restarting application if you make some betta version, I can help you to test it 🙂

    BR,
    Arsen.

Leave a Reply