Click here to Skip to main content
15,881,139 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have an app and it freezes after a long period of use . I have read a lot about posible causes ( overload UI thread , leaks, ect... ). But instead of get the root of the problem I would like to detect when its in a frozen state and restart/reload it.
I can check when the process its not responsive/alive but thats not what I meant.

How can I know that my UI ( or the UI Thread) is frozen ? I checked watcherdog systems but still I can not determine when the app its freeze.

What I have tried:

I have managed the
UnhandledException
from App in order to restart the app , and also I check if process still alive , but not what I really want.
Posted
Comments
[no name] 8-Feb-17 6:19am    
It's your bug, you actually have no other choice but to fix it. Reading about it is a very lightweight start. You must develop your own hypothesis about the problem and then work out a way to confirm or refute the hypothesis.
Despite my earlier statement read this: How to debug crashes and hangs – Kirill Osenkov[^]
[no name] 8-Feb-17 6:50am    
How would you logically think that your program could monitor itself when it's not responsive? Or do you think that some magic process can know that your program is not responding?
Asgard25 2-Apr-17 13:11pm    
I'm not so sure about in wpf, but if you really have to test it, create a new non-ui thread in Application_Startup I'd say. Get your app's process(Process.GetProcesses()) and check if it is responding, if not kill and launch it again. Just do proper testing when doing this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900