• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 273
  • Last Modified:

What is the best way to diagnose reason for an application not responding?

Hi experts
I'd written a winform C# application. Recently, I was told by an internal customer that the application would occasionally become not responding when it is re-accessed after leaving it idle for a while. When the situation happened, the application needed to be forcefully terminated.

I am not sure whether it was due to a fault inside my application, or other applications that were running at that time, or Windows issue.

What is the best way to diagnose this sort of problem?

Thanks in advance.
0
dominicwong
Asked:
dominicwong
  • 4
  • 2
  • 2
  • +1
3 Solutions
 
Joseph OLoughlinIT Support SpecialistCommented:
One tool is sysinternals procmon.
Filter on your app to see what registry keys, files etc are open, what permissions are being checked (checking permissions on a domain account can sometimes be the delay).
0
 
Karrtik IyerSoftware ArchitectCommented:
Hi,
I would start off with the following steps, not in any particular order: ( I don't see any straight forward solution)
1. Analyze the logs of my .Net application for 2-3 scenarios that result in non responsive conditions, identify if there is any particular operation or user action which is triggering this issue?
2. If your code is multi-threaded, then I shall also analyze my shared resources to see if there is any resource for which some thread is waiting infinitely. Also ensure that there are no static resources in this code.
3. Also if you are doing any file i/o etc.. I would check if the same file is open in some other process. The same holds good if you are using a DB and if the record that you are trying to access is locked and your thread is waiting infinitely.
4. Also alternatively look at the other operations happening on that system at the same time when your apps becomes unresponsive.
5.  Also check my code if there is any recursive logic which gets triggered on a condition that results in infinite loop.
6. Do static and dynamic analysis/profiling of C# code using Microsoft tools.
Thanks,
Karrtik
0
 
dominicwongAuthor Commented:
Thanks Karrtik.
Could you give me the names of these static and dynamic analysis/profiling Microsoft tools please?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Karrtik IyerSoftware ArchitectCommented:
Hi Dominic,

Here are some links, you can get them from Google search as well if you search of visual studio code analysis.
I am not sure which version of visual studio you are using, I have posted 2012 version's links.
Please let me know if you need further help.
Thanks,
Karrtik

Using Code Analysis with Visual Studio
Code Analysis Team Blog
Analyzing Application Quality by Using Code Analysis Tools
0
 
BakuRetsu_XCommented:
Tell us more about your application.
What does it do?  How does it run?  How does it log errors?
Are you using unmanaged 3rd party code? COM items?
Is it marshaling methods?

Have you check the eventvwr to see if there are any alerts or warning logged?
0
 
dominicwongAuthor Commented:
Thanks BakuRetsu X.
The problem just happened again. It was sitting idle, and the user tried to open a file through the application.
I checked the memory of the process. It was fairly minimal so it wasn't a memory leakage issue.
Just tried using the sysinternals "handle" and "process explorer" tools, I could see the application was still running: created thread and exit from thread.
The application logs errors by writing to a local file. There're some unmanaged 3rd party code and marshalling methods. But I don't think the marshalling methods were running when the problem happened.
No, I haven't checked the eventvwr.
0
 
dominicwongAuthor Commented:
Thanks Karrtik for sharing me the links. I am using VS2008.
0
 
Joseph OLoughlinIT Support SpecialistCommented:
File operations can be interfered by 'handlers', and there can be several daisy-chained together, for example the normal file open operating system operations, an open file agent like (volume) shadow copy, a document management program and an antivirus program checking to see if the file is safe.  
Use procmon to filter on the file and see what's stomping on it.
Also compare the output of (running cmd.exe as administrator with elevation)
C:\> vssadmin list providers
C:\> vssadmin list shadows
C:\> vssadmin list writers
between the problem machine and similarly configured non problem machine
Also check for corruption.
0
 
dominicwongAuthor Commented:
I have yet to find out the real cause of the problem. But thanks everyone for your valuable input.
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 4
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now