views:

181

answers:

2

Hi

I am kind of lost here, and I don't know what to do

I have a problem that I don't know what the source of it. We have a large wpf application, that is built similar to prism (composite application) Actually we are using lots of prism library. I wrote a module to replace an existing module. And the application now is loading my module, instead of the old module.

I start to notice, with the new module, that sometimes the application freeze for 20-30 seconds without any response, and then it work smoothly after that.

The freeze is not consistent, and there is no pattern or a specific reason that cause it.

I am suspecting that could be my module that is causing that freeze. But at the same time, many other developers introduced new code to the application.

My question is there a way to trace that freeze? Is there a way to compare the old module and the new module that I wrote?

I can run the application with my module, and trace the application, and then I can change the config file to load the old module. Is there a way to compare between the two?

Should I do profiling? and if profiling will help, then what should I look for? any other tool could help?

Thanks a lot for any reply

+1  A: 

It sounds like you are doing a long running operation on your UI thread. Are you making any database / webservice calls from the main thread? I think one of the easiest things to do is run it in the debugger, and when it freezes, hit the "pause" button. Visual Studio will pause execution at the current location, and you can examine what is taking so long.

If the problem isn't immediately obvious there, I would definitely start profiling the application to track this down.

Abe Heidebrecht
A: 

May be nature of my problem is similar to you.

I have a loop let say 1000 cycles. In each step, I increase value of System.Windows.Controls.ProgressBar.Value and a Foo method call (which take may be 30 milliseconds).

Once I run the program, From was frozen and cannot even click one other control or move the form. After about 10 to 15 seconds, the form work well.

I tried to us Asyn Call for method Foo delegate void MethodDelegate(); MethodDelegate methodDelegate = Foo; IAsyncResult ar = methodDelegate.BeginInvoke(null, null); methodDelegate.EndInvoke(ar);

But the problem still remain the same.

Please help.

.Tola.

Tola Ch.