From:             lukasz at fsi dot pl
Operating system: FreeBSD 6.4
PHP version:      5.2.8
PHP Bug Type:     PDO related
Bug description:  memory leak in PDO::prepare while using pdo_pgsql

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 bug report at http://bugs.php.net/?id=47514&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=47514&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=47514&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=47514&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=47514&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=47514&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=47514&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=47514&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=47514&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=47514&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=47514&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=47514&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=47514&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=47514&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=47514&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=47514&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=47514&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=47514&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=47514&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=47514&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=47514&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=47514&r=mysqlcfg

Reply via email to