#40172 [NEW]: date() function memory leak

From: Date: Fri, 19 Jan 2007 16:52:52 +0000
Subject: #40172 [NEW]: date() function memory leak
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-107776@lists.php.net to get a copy of this message
From: diogo86 at gmail dot com Operating system: Debian PHP version: 5.2.0 PHP Bug Type: Performance problem Bug description: date() function memory leak Description: ------------ The date() function keep consuming memory each time it's called even if it's not assigned to any variable. Reproduce code: --------------- <?php for($i=0; $i<10000; $i++) date('d/m/Y H:i:s'); echo memory_get_usage(); ?> Expected result: ---------------- Something about 46436 bytes of memory usage just like when I call this statement inside that loop: $str = strtoupper($_SERVER['PHP_SELF']); Actual result: -------------- 5485532 bytes of memory usage. ---- Debian Linux 2.6.15-1-486 PHP 5.2.0-8 (cli) (built: Dec 17 2006 20:03:51) [PHP Modules] bcmath bz2 calendar ctype date dba dom exif filter ftp gettext hash iconv json libxml mbstring mime_magic ncurses openssl pcntl pcre PDO pdo_pgsql posix Reflection session shmop SimpleXML soap sockets SPL standard sysvmsg sysvsem sysvshm tokenizer wddx xml xmlreader xmlwriter zip zlib [Zend Modules] -- Edit bug report at http://bugs.php.net/?id=40172&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40172&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40172&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40172&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=40172&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=40172&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=40172&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=40172&r=needscript Try newer version: http://bugs.php.net/fix.php?id=40172&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=40172&r=support Expected behavior: http://bugs.php.net/fix.php?id=40172&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=40172&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=40172&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=40172&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40172&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=40172&r=dst IIS Stability: http://bugs.php.net/fix.php?id=40172&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=40172&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=40172&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=40172&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=40172&r=mysqlcfg

« previous php.bugs (#107776) next »