#20999 [Ana->Dup]: memory leak when using DB interface

From: Date: Wed, 11 Jun 2003 17:17:43 +0000
Subject: #20999 [Ana->Dup]: memory leak when using DB interface
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-17317@lists.php.net to get a copy of this message
ID: 20999 Updated by: cox@php.net Reported By: dinoklein at hotmail dot com -Status: Analyzed +Status: Duplicate Bug Type: PEAR related Operating System: Linux 2.4 PHP Version: 4.3.0RC3 Assigned To: ssb New Comment: As Lukas said this is duplicated with #18494, which it's fixed now in cvs. Thanks for reporting Previous Comments: ------------------------------------------------------------------------ [2003-05-04 12:25:39] lsmith@php.net My wild guess is that this is related to http://bugs.php.net/bug.php?id=18494 ------------------------------------------------------------------------ [2003-04-28 04:00:26] arnaud@php.net changing status ------------------------------------------------------------------------ [2002-12-13 14:49:32] dinoklein at hotmail dot com By running the code below, both the http process executing the script, and the php binary (when run on the command line), grow in memory size. In the case of the http module, the memory is not freed once the script has terminated. This happens when using MySQL as the backend, and with PgSQL. This does not happen when I use the pg_* functions directly. I have not tested mysql_*. <?php require 'DB.php'; function db_connect() { //$dsn = 'pgsql://dinoklein@unix+localhost/unicode'; $dsn = 'mysql://test@unix+localhost/test'; return DB::Connect($dsn); } header('Content-Type: text/html'); $db = db_connect(); $sql_ins = 'insert into ttable values (?)'; for ($i=0; $i<25000; $i++) { echo "doing $i\n"; $ret = $db->query($sql_ins, array("code $i")); if (DB::isError($ret)) { echo "error on insert\n"; break; } } $db->disconnect(); ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=20999&edit=1

« previous php.pear.dev (#17317) next »