Solved

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

Posted on 2014-09-16
9
256 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

You may have a outside contractor who comes in once a week or seasonal to do some work in your office but you only want to give him access to the programs and files he needs and keep privet all other documents and programs, can you do this on a loca…
On some Windows 7 (SP1) computers, Windows Update becomes super slow even the computer is reasonably fast.  There's one solution that seemed to have worked well for me (after trying a few other suggested solutions).
This Micro Tutorial will go in depth within Systems and Security in Windows 7 and will go into detail regarding Action Center, Windows Firewall, System, etc. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.

730 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