SqlCommand.Dispose() not disposing the SqlParameters in it - Memory Leak - C#.NET
Posted
by NLV
on Stack Overflow
See other posts from Stack Overflow
or by NLV
Published on 2010-06-09T19:13:13Z
Indexed on
2010/06/09
19:22 UTC
Read the original article
Hit count: 961
Hello
I've a windows forms application with MS SQL Server 2005 as the back end. I have written code in the form to call few stored procedures using SqlConnection, SqlCommand objects and i properly dispose everything.
I've disposed sqlcommand object by calling
oSqlCommand.Dispose()
But i witnessed my application consuming huge amount of memory. I basically pass large XML files as SqlParameters.
I finally decided to memory profile it using RedGate Memory profiler and i noticed that the System.Data.SqlClient.SqlParameters
are not disposed.
Any insights on this?
Thanks
NLV
© Stack Overflow or respective owner