Find unclosed connection

Memory profiling for .NET developers

Moderators: Luke Jefferson, StephenC, AndrewH, melvyn.harbour, james.billings, Laura Morley, dene.boulton

Find unclosed connection

Postby Corobori » Tue Aug 27, 2013 8:51 pm

Is it possible to find unclosed connection to SQL Server with this product ?
Posts: 1
Joined: Tue Aug 27, 2013 8:28 pm

Postby james.billings » Thu Aug 29, 2013 7:49 am

In answer to your question- possibly.
The actual connections to SQL Server will generally be handled by the .NET framework, and these get recycled and re-used so it's not as simple as just looking for the number of connections to the database.

You could certainly filter the results and look for sqlconnection objects and see if the count of these is going up. If you're creating a connection when a child-screen is opened up and something is not disposing of it when you close the screen, these may increase as objects in memory. You may also find memory goes up due to resultsets from those queries also hanging around.

I'd suggest checking over the QueryBee example:

And also strategies for using the profiler:
Posts: 1146
Joined: Wed Jun 16, 2010 11:10 am
Location: My desk.

Return to ANTS Memory Profiler 7

Who is online

Users browsing this forum: No registered users and 1 guest