|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20999 memory leak when using DB interface
Submitted: 2002-12-13 14:49 UTC Modified: 2003-07-28 04:59 UTC
From: dinoklein at hotmail dot com Assigned: ssb (profile)
Status: Closed Package: PEAR related
PHP Version: 4.3.0RC3 OS: Linux 2.4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: dinoklein at hotmail dot com
New email:
PHP Version: OS:


 [2002-12-13 14:49 UTC] 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_*.

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";


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-28 04:00 UTC]
changing status
 [2003-05-04 12:25 UTC]
My wild guess is that this is related to
 [2003-06-11 12:17 UTC]
As Lukas said this is duplicated with #18494, which it's fixed now in cvs.

Thanks for reporting
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Sep 17 08:03:36 2021 UTC