|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-11-03 13:41 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 11:00:02 2025 UTC |
Description: ------------ Simple program: // remember used memory $start = memory_get_usage(); $dbh = new PDO('mysql:...','...','...'); // create empty table $dbh->query('DROP TABLE IF EXISTS ttt;'); $dbh->query("CREATE TABLE ttt ( id integer, args longtext);"); // simple code function doQuery($id) { static $sth; if( !$sth ) $sth = $GLOBALS['dbh']->prepare("SELECT * FROM ttt WHERE id = ?"); $sth->execute(array($id)); return $sth->fetchAll(); } var_dump(doQuery('5')); echo memory_get_usage()-$start; // eats 1 megabyte of memory. // if I duplicate doQuery()->doQuery2() // and call doQuery2() - it eats 2(!!) Mb of memory // if I remove LONGTEXT, everything is OK. Reproduce code: --------------- see above. Expected result: ---------------- Please, not so much memory!