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

From: Date: Sat, 02 Jul 2005 16:18:38 +0000
Subject: Bug #4724 [Opn]: memory leak when using function query with DB_Dataobject
References: 1  Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-6442@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=4724&edit=1 ID: 4724 Updated by: danielc@analysisandsolutions.com Reported By: jdelahayes at tf1 dot fr Status: Open Type: Bug Package: Documentation Operating System: fedora core 3 PHP Version: 5_1 CVS-2005-07-01 New Comment: Change Package/Category from "Documentation" to "DB_DataObject". Previous Comments: ------------------------------------------------------------------------ [2005-07-01 10:37:29] jdelahayes at tf1 dot fr 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 this bug report at http://pear.php.net/bugs/bug.php?id=4724&edit=1

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