If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > PHP > Memory leak using ibm_db2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-22-10, 17:04
Brandon765 Brandon765 is offline
Registered User
 
Join Date: Dec 2009
Posts: 20
Memory leak using ibm_db2

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):

<?php


$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
exit;
?>
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On