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.
dominicwongAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dominicwongAuthor Commented:
Thanks Karrtik.
Could you give me the names of these static and dynamic analysis/profiling Microsoft tools please?
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 7

From novice to tech pro — start learning today.