If I access the following ASP-page thousands of times with MS Web Application Stress Tool the inetinfo.exe private bytes grows and grows until it stops... Memory leak? Why?
NT4SP6a, Oracle OLE DB 8.1.7.1.0, MDAC 2.6.
ASP-file:
<%@ENABLESESSIONSTATE=FALSE%>
<!--METADATA TYPE="TypeLib" FILE="C:\Program Files\Common Files\system\ado\msado15.dll" -->
<%Option Explicit
Response.Expires = -1
Response.Write("<html><head><title>Mem leak</title></head><body>"
Public Function GetConnection() 'As ADODB.Connection
Set GetConnection = Server.CreateObject("ADODB.Connection"
With GetConnection
.CursorLocation = adUseClient
.ConnectionTimeout = 60
.ConnectionString = "Provider=OraOLEDB.Oracle;User ID=xxx;Password=yyy;Persist Security Info=True;Data Source=zzz;CacheType=Memory;DistribTX=0"
.Open
End With
End Function
' Here the docid is randomized it leaks without this
Randomize
dim docid,idocid
docid=Int((3 * Rnd) + 1)
Select case docid
case 1 idocid=1
case 2 idocid=541
case 3 idocid=463
End select
' Here comes the actual code
Dim oCm
Dim oConn
Set oCm = Server.CreateObject("ADODB.Command"
Set OcONN = GetConnection()
Set oCm.ActiveConnection = oConn
With oCm
.Parameters.Append .CreateParameter("p_document", adInteger, adParamInput, , iDocId)
.Parameters.Append .CreateParameter("p_meta_description", adVarChar, adParamOutput, 255)
.Parameters.Append .CreateParameter("p_meta_keywords", adVarChar, adParamOutput, 255)
.Parameters.Append .CreateParameter("p_status", adInteger, adParamOutput)
End With
oCm.CommandText = "{CALL CMS_GET_DOCUMENT.get_document_meta_by_document(?,?,?,?)}"
oCm.Properties("PLSQLRSet"
= False
oCm.Execute
Response.Write oCm.Parameters(1).value & "<br>" & oCm.Parameters(2).value & "<br>"
'Here we clean up all the created objects
oConn.Close
Set oConn = Nothing
Set oCm.ActiveConnection = Nothing
Set oCm = nothing
Response.Write("</body></html>"
%>
NT4SP6a, Oracle OLE DB 8.1.7.1.0, MDAC 2.6.
ASP-file:
<%@ENABLESESSIONSTATE=FALSE%>
<!--METADATA TYPE="TypeLib" FILE="C:\Program Files\Common Files\system\ado\msado15.dll" -->
<%Option Explicit
Response.Expires = -1
Response.Write("<html><head><title>Mem leak</title></head><body>"
Public Function GetConnection() 'As ADODB.Connection
Set GetConnection = Server.CreateObject("ADODB.Connection"
With GetConnection
.CursorLocation = adUseClient
.ConnectionTimeout = 60
.ConnectionString = "Provider=OraOLEDB.Oracle;User ID=xxx;Password=yyy;Persist Security Info=True;Data Source=zzz;CacheType=Memory;DistribTX=0"
.Open
End With
End Function
' Here the docid is randomized it leaks without this
Randomize
dim docid,idocid
docid=Int((3 * Rnd) + 1)
Select case docid
case 1 idocid=1
case 2 idocid=541
case 3 idocid=463
End select
' Here comes the actual code
Dim oCm
Dim oConn
Set oCm = Server.CreateObject("ADODB.Command"
Set OcONN = GetConnection()
Set oCm.ActiveConnection = oConn
With oCm
.Parameters.Append .CreateParameter("p_document", adInteger, adParamInput, , iDocId)
.Parameters.Append .CreateParameter("p_meta_description", adVarChar, adParamOutput, 255)
.Parameters.Append .CreateParameter("p_meta_keywords", adVarChar, adParamOutput, 255)
.Parameters.Append .CreateParameter("p_status", adInteger, adParamOutput)
End With
oCm.CommandText = "{CALL CMS_GET_DOCUMENT.get_document_meta_by_document(?,?,?,?)}"
oCm.Properties("PLSQLRSet"
oCm.Execute
Response.Write oCm.Parameters(1).value & "<br>" & oCm.Parameters(2).value & "<br>"
'Here we clean up all the created objects
oConn.Close
Set oConn = Nothing
Set oCm.ActiveConnection = Nothing
Set oCm = nothing
Response.Write("</body></html>"