yes, gobjOraConnection exists for the whole life of my application. There's another things I noticed: If i close the connection, the memory needed doubles from 3.5mb to 7mb and then slowly comes down again. Strange ...
the_saw_is_the_law
Posts
-
[ADO] leaking memory when opening/closing connection every minute -
[ADO] leaking memory when opening/closing connection every minuteI am developing a VB application using ADO which polls an adabas d DB and an oracle DB every minute. It seems that this programm leaks some 15mb memory every day if I open and close the connection every minute. This behaviour doesn't occur when I open the connection just once and keep it alive. Am I doing something wrong? Is this a bug? Or is this "by design"? Michael NT 4.0 SP5 & SP6a VB6 SP5 MDAC 2.7 adabas d 11.01 oracle 8.1.5 code snippet: Public gobjOraConnection As New ADODB.Connection Public gobjOraCommand As New ADODB.Command Dim objOraRecordSet as ADODB.RecordSet ' aufbauen strConnectionString = "DSN=" & gstrOraService & ";UID=" & gstrOraUsername & ";PWD=" & gstrOraPasswort ' Verbindung herstellen gobjOraConnection.ConnectionString = strConnectionString gobjOraConnection.Open Set gobjOraCommand.ActiveConnection = gobjOraConnection ' In der Oracle DB nach Aufträgen suchen strSQL = "SELECT * FROM " & gstrOraTable & " WHERE XCHG_RESCODE IS NULL" gobjOraCommand.CommandText = strSQL ' Ergebnisobjekt zuweisen Set objOraRecordSet = gobjOraCommand.Execute("adCmdText") objOraRecordSet.Close set objOraRecordSet = Nothing Set gobjOraCommand.ActiveConnection = Nothing gobjOraConnection.Close