user109078
user109078

Reputation: 906

Odd performance degradation in application

We have an application that is mixed .NET 2.0 and native C++. In our testing, we have a mode which can automatically loop through a set of projects. A project opens, runs, closes, repeat. Each of these steps requires creation/destruction of windows (winforms to be precise). Recently we've experienced some odd behavior in performance. After running for a few hours the opening and closing parts slow down (blocking the gui thread and showing half drawn screens etc). Now it would be easy to chock this up to a resource leak...but we're tracking handles and memory, and while memory grows slightly there's nothing to indicate this level of problem. Handles are stable. So maybe dangling event handlers...still need to investigate that. But the kicker, which perplexes me, is that shutting down the application and restarting it doesn't bring back the initial performance. It's still slow until I reboot the OS (win XP) and then performance starts out snappy again. This really perplexes me as I assume shutting down the application will reclaim all resources. Any thoughts?

Upvotes: 5

Views: 353

Answers (3)

user109078
user109078

Reputation: 906

We were leaking window classes

Upvotes: 0

Joseph
Joseph

Reputation: 383

You're assuming its a resource leak (which isn't a bad guess), but it might be something else.

Have you tried using a performance profiler?

Upvotes: 0

Mitch Wheat
Mitch Wheat

Reputation: 300549

Sounds like a possible GDI handle leak. GDI objects are not automatically picked up by the Garbage Collector.

.NET Memory Profiler (http://memprofiler.com/) does a good job of tracking these (there is a 14 day trial version).

Have you seen these:

Upvotes: 1

Related Questions