Ghassan Karwchan
Ghassan Karwchan

Reputation: 3540

WPF application freeze

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

Upvotes: 0

Views: 903

Answers (1)

Abe Heidebrecht
Abe Heidebrecht

Reputation: 30498

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.

Upvotes: 1

Related Questions