We are running XP on our database server with PHP 5.2.8. We are using ibm_db2.dll version 1.6. About every 2 days or so, our server is crashing due to running out of memory. Looking at the task manager, apache.exe will be around 1.7GB to 2 GB. I have been trying to narrow it down for the past week. Finally, I think I have concluded that it is in the db2_connect() function. I have written a little php script that does nothing but db2_connect and if successful does a db2_close(). I wrote a perl file on another machine that just loops calling the php script. I let this run and can watch the apache.exe memory usage keep climbing until it peaks out and causes apache to be unresponsive. I have to cycle apache to clean it up (stopping the requests coming in will not allow apache to clean up). I found version 1.8.2 of ibm_db2.dll today and have installed it, but I get the same results.

Anyone seen anything like this before or have any ideas how to fix this. Our production server has to have apache cycled about every 2 days. That is a huge pain!!

Thanks for any help.

The code from my test script is below (very simple):


$options = array();
$conn = "";
$conn = db2_connect('SAMPLE', '', '', $options);

print "<return>\n";
if ($conn) {
print "Connection Successful \n";
$result = db2_close($conn);
if ($result == true) {
print "Disconnect Successful \n";
} else {
print "Disconnect Failed \n";
} else {
print "Connection Failed \n";

print "\n";
flush(); // Force PHP to flush the buffers