php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59661 Memory leak when run through apache
Submitted: 2011-03-10 11:13 UTC Modified: 2015-04-05 04:22 UTC
From: elm dot morrow at allegiantair dot com Assigned:
Status: No Feedback Package: ibm_db2 (PECL)
PHP Version: 5.2.5 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
35 - 34 = ?
Subscribe to this entry?

 
 [2011-03-10 11:13 UTC] elm dot morrow at allegiantair dot com
Description:
------------
Whenever I create a db connection (db2_connect) in an apache-based process even after I close the connection I never get the memory back.  This can cause severe issues if ad-hoc connections are created on a long-running apache child process.

NOTE: I was asked to post this by IBM driver developer Praveen Devarao back on 1/27/11.

Reproduce code:
---------------
I don't have a publicly-available URL I can point you to to reproduce this.  However, I do have code that can make this happen but it's more than 20 lines of code all-told.

Please advise.

Expected result:
----------------
All memory used to create db2 connection should be released.

Actual result:
--------------
Memory is not released.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-14 07:26 UTC] abhargav at in dot ibm dot com
Hi Elm,

I tried following test case to repro the problem:

<?php
$user = "db2inst1";
$pass = "secret";
$mydb = "phpdb";
$port = 60020;
$host = "localhost";

$dsn  = "DATABASE=$mydb;UID=$user;PWD=$pass;PORT=$port;HOSTNAME=$host;PROTOCOL=TCPIP;";

$i = 0;

while($i < 50000) {
 $conn = db2_connect($dsn, "", "");
 $i = $i + 1;
 echo "$i, ";
}
echo "\nTesting Done\n";
?>

When this test is running, I don't see any mem usage shoot up for the apache process.

>>>
I do have code that can make this happen but it's more than 20 lines of code all-told.
<<<
You can paste your test case to this thread itself. 

Regards,
Ambrish Bhargava
 [2015-03-23 19:35 UTC] cmb@php.net
-Status: Open +Status: Feedback
 [2015-03-23 19:35 UTC] cmb@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
 [2015-04-05 04:22 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Aug 19 20:01:30 2019 UTC