Solved

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

Posted on 2014-09-16
9
245 Views
Last Modified: 2014-09-25
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
Comment
Question by:dominicwong
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 11

Expert Comment

by:Joseph O'Loughlin
ID: 40324777
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
 
LVL 15

Accepted Solution

by:
Karrtik Iyer earned 250 total points
ID: 40325391
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
 

Author Comment

by:dominicwong
ID: 40326894
Thanks Karrtik.
Could you give me the names of these static and dynamic analysis/profiling Microsoft tools please?
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 15

Expert Comment

by:Karrtik Iyer
ID: 40327874
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
 
LVL 2

Assisted Solution

by:BakuRetsu_X
BakuRetsu_X earned 100 total points
ID: 40328714
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
 

Author Comment

by:dominicwong
ID: 40332046
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
 

Author Comment

by:dominicwong
ID: 40332050
Thanks Karrtik for sharing me the links. I am using VS2008.
0
 
LVL 11

Assisted Solution

by:Joseph O'Loughlin
Joseph O'Loughlin earned 150 total points
ID: 40333742
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
 

Author Closing Comment

by:dominicwong
ID: 40345180
I have yet to find out the real cause of the problem. But thanks everyone for your valuable input.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
By default the complete memory dump option is disabled in windows . If we want to enable the complete memory dump for a diagnostic purpose, we have a solution for it. here we are using the registry method to enable this.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question