|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-10-26 11:12 UTC] jani@php.net
[2008-11-03 01:00 UTC] php-bugs at lists dot php dot net
[2010-08-18 12:31 UTC] andrey@php.net
-Package: MySQL related
+Package: Scripting Engine problem
[2010-08-18 12:31 UTC] andrey@php.net
[2010-11-02 17:33 UTC] felipe@php.net
-Status: No Feedback
+Status: Feedback
[2010-11-02 17:33 UTC] felipe@php.net
[2013-02-18 00:33 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 20:00:01 2025 UTC |
Description: ------------ I run some code 5 million itteration yesterday, today I change my string building to use single quotes and the dot operator. That version was able to do aprox 25k itterations then the script died due memory leak. Reproduce code: --------------- # Makign a string like this leaks NOT memory # $lInsert = "Insert into {$this->mTable} (datetime,entity_id,entity_type,domain,country,location,raws,uniques)" . # " values ('{$this->getDateTime()}',{$this->getEntityId()},{$this->getEntityType()},{$this->getDomain()}," . # "{$this->getCountry()},{$this->getLocation()},{$this->getRaws()},{$this->getUniques()});"; # Making a string liek this leaks memory when doign execute $lInsert = 'Insert into '.$this->mTable.' (datetime,entity_id,entity_type,domain,country,location,raws,uniques)' . ' values ("'.$this->getDateTime().'",'.$this->getEntityId().','.$this->getEntityType().','.$this->getDomain().',' .$this->getCountry().','.$this->getLocation().','.$this->getRaws().','.$this->getUniques().');'; # $lInsert = "Insert into {$this->mTable} (datetime,entity_id,entity_type,domain,country,location,raws,uniques)" . # " values ('{$lTimeStamp}',{$lEntityId},{$lEntityType},{$lDomain},{$lCountry},{$lLocation},{$lRaws},{$lUniques})"; # print memory_get_usage()."\n"; $lStatement =& $this->mDbh->prepare($lInsert); if (MDB2::isError($lStatement)){ error_log($lStatement->getMessage().';query:'.$lInsert.' '.$lStatement->userinfo); $lResult = false; } else { $lResult =& $lStatement->execute(); $lStatement->free(); } Expected result: ---------------- See code comments Actual result: -------------- see code comments