lasers
Technical User
- Oct 24, 2007
- 12
I'm trying to figure out why there is such a memory leak with a simple asp script like that shown below.
When I open the page, I notice in windows task manager on the server that the application that the page belongs to increases it's memory usage alot. After one load of the page, it is up to 10 mb. Why would this happen with such a simple script, even when the objects are cleaned up?
Code:
Option Explicit
dim dCon, sqlStat, rs, i
Set dCon = Server.CreateObject("ADODB.Connection")
dCon.ConnectionTimeout=20
dCon.open "Driver={SQL Server};Server=servername;Database=dbname;Uid=user;Pwd=pass;"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.CursorType = 3
rs.LockType = 1
sqlStat = "select * from [Table];"
rs.open sqlStat, dCon
If Not rs.eof Then
Do Until rs.eof
i = i + 1
rs.movenext
Loop
End If
rs.close
Set rs = Nothing
dCon.close
Set dCon = Nothing
When I open the page, I notice in windows task manager on the server that the application that the page belongs to increases it's memory usage alot. After one load of the page, it is up to 10 mb. Why would this happen with such a simple script, even when the objects are cleaned up?