#47514 [Opn->Bgs]: memory leak in PDO::prepare while using pdo_pgsql

From: Date: Tue, 03 Mar 2009 01:18:19 +0000
Subject: #47514 [Opn->Bgs]: memory leak in PDO::prepare while using pdo_pgsql
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-134355@lists.php.net to get a copy of this message
 ID:               47514
 Updated by:       iliaa@php.net
 Reported By:      lukasz at fsi dot pl
-Status:           Open
+Status:           Bogus
 Bug Type:         PDO related
 Operating System: FreeBSD 6.4
 PHP Version:      5.2.8
 New Comment:

Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

memory usage does not appear to change is latest cvs


Previous Comments:
------------------------------------------------------------------------

[2009-02-26 23:25:52] lukasz at fsi dot pl

Description:
------------
Calling prepare() for pdo_pgsql connection consumes memory which is
never being freed. Specified query doesn't matter. It seems that this
happen because in my case pdo_pgsql does not use native prepared
statements, but I can't find the reason for this. I think so because
calling prepare("foo") does not cause an error as it does when I use
pdo_mysql.

Reproduce code:
---------------
$a = new PDO('pgsql:'.$some_pdo_pgsql_dsn);
for ($i = 0; $i < 1000000; $i++)
{
    $st = $a->prepare("");
    print(memory_get_usage(true)."\n");
    unset($st);
}


Expected result:
----------------
constant memory usage

Actual result:
--------------
increasing memory usage


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=47514&edit=1



Thread (6 messages)

« previous php.bugs (#134355) next »