OLEDB, sql server, and memory leak
- From: pbx <pbeisel@xxxxxxxxx>
- Date: Mon, 18 Jun 2007 10:47:18 -0700
I am running a managed application (ASP.NET)... it is leaking
unmanaged memory.
Using the debug diagnostic tool 1.1, the dump analysis report shows
that:
msdatl3.dll (a known Windows memory manager) is responsible for 828.81
MBytes worth of outstanding allocations. These allocations
appear to have originated from the following module(s) and
function(s):
sqloledb!CDBConnection::GetColData+2c8
The code involved in this leak is performing a SELECT and then reads
the data. One db field of concern is typed nvarchar(MAX).
The code basically looks like this:
Dim x,y,x as String
Dim reader As OleDbDataReader
Dim sqlstr As String = "SELECT * FROM pages WHERE pID = some page id
Dim cmd As New OleDbCommand(sqlstr, db.getconnection())
reader = cmd.ExecuteReader
reader.Read()
If reader.HasRows() Then
x = reader("col1")
y = reader("col2")
z = reader("col3") ' where col3 is of type nvarchar(MAX)
End If
reader.Close()
The size of col3, nvarchar(MAX), varies between 2,000 and 80,000
bytes.
Question: what am I doing wrong? Am I failing to clean up in some
way (I thought all I had to do was close the reader). Is there a
different/better way to read the nvarchar(MAX) field?
thanks.
.
- Follow-Ups:
- Re: OLEDB, sql server, and memory leak
- From: Mary Chipman [MSFT]
- Re: OLEDB, sql server, and memory leak
- Prev by Date: Jet 4 - Excel ISAM - IRowsetChange
- Next by Date: Re: OLEDB, sql server, and unmanaged heap memory leak Options
- Previous by thread: Jet 4 - Excel ISAM - IRowsetChange
- Next by thread: Re: OLEDB, sql server, and memory leak
- Index(es):
Relevant Pages
|
|