djw
Starting Member
2 Posts |
Posted - 27 June 2001 : 15:14:22
|
What is wrong with our test code? We have a W2K server SP2 running iis5 and we use ODBC (native windows Paradox & Merant 3.70) to access a Paradox 5 data base table called by an ASP page. This combination yields a memory leak. We see this leak in the ALWAYS increasing dllhost.exe "Memory Usage" until iis5 freezes. We also notice that the "Total Handles" ALWAYS increases. With the following ASP (See below) we have Memory leak. With the following PHP (See below ASP) we DO NOT have Memory leak. <%@ Language=VBScript %> <% Response.Buffer = True %>
<!-- #INCLUDE FILE = "../search/Connect.inc" --> <!-- #INCLUDE FILE = "../search/adovbs.inc" -->
<html> <body>
<% Dim djwRec,vI Set djwRec = Server.CreateObject("ADODB.Recordset") For vI = 1 to 100 djwRec.Open "SELECT * FROM Stock" ,vConn, adOpenKeyset, adLockReadOnly, adCmdText %> <B>Test <%=vI%></B><BR> <% djwRec.Close Response.Flush Next Set djwRec = Nothing vConn.Close Set vConn = Nothing %>
</body> </html>
With the following PHP we DO NOT have Memory leak. <html> <body>
<? //loop this much $times = 10;
for($i = 0; $i< $times; $i++){ $connid = odbc_connect("Diamond", "", ""); //connect to the database
$result = odbc_do($connid, "SELECT * FROM Stock WHERE `Product Type` = 'D'"); //execute an SQL query
echo "$i\t: " . odbc_result($result, "Lot No") . "<br>\n"; //get some data from that query and output it
odbc_free_result($result); //free the query result's memory odbc_close($connid); //close the database connect }
?>
</body> </html>
|
|