Bug #4724 [NEW]: memory leak when using function query with DB_Dataobject

From: Date: Fri, 01 Jul 2005 14:37:29 +0000
Subject: Bug #4724 [NEW]: memory leak when using function query with DB_Dataobject
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-6432@lists.php.net to get a copy of this message
From: jdelahayes at tf1 dot fr Operating system: fedora core 3 PHP version: 5_1 CVS-2005-07-01 Package: Documentation Bug Type: Bug Bug description: memory leak when using function query with DB_Dataobject Description: ------------ When where are using DB_DataObject query function, in a loop, the httpd process make a memory leak. PHP 5.1.0b2 Apache 2.0.54 DB 1.7.6 DB_DataObject 1.7.14 PEAR 1.3.5 Reproduce code: --------------- Here is the sample code to reproduce the problem of memory leak: <?php error_reporting(E_ALL); require_once("../phplib/DBO/classes/Guide_reglement.php"); $options = &PEAR::getStaticProperty('DB_DataObject','options'); $config = parse_ini_file('/home/mboutillier/ECLIPSE_WS/IXIAM/conf/dbo.ini',TRUE); $options = $config['DB_DataObject']; $sqlQuery="SELECT guide_reglement_num,guide_reglement_code, guide_reglement_libelle,guide_reglement_montant_min, p.param_pays_interdit_gnxcode from guide_reglement g, param_pays_interdit p where g.guide_reglement_interdiction=p.param_pays_interdit_num and guide_reglement_date_debut<=CURDATE() and guide_reglement_date_fin>=CURDATE() and guide_reglement_statut='ACT' and guide_reglement_mode_paiement_num=1"; for($i=0; $i<5000; $i++) { $guideReglement = new DBO_Guide_reglement(); $guideReglement->query($sqlQuery); $guideReglement->fetch(); unset($guideReglement); } ?> Expected result: ---------------- No memory leak ! Actual result: -------------- the httpd process make a memory leak. It take 200Mo of RAM at the end of the execution of the sample. -- Edit bug report at http://pear.php.net/bugs/bug.php?id=4724&edit=1 --

« previous php.pear.doc (#6432) next »