#46075 [Opn->Fbk]: strftime memory leak?
ID: 46075
Updated by: jani@php.net
Reported By: acc_php at riggers dot me dot uk
-Status: Open
+Status: Feedback
Bug Type: Date/time related
Operating System: Vista x64
PHP Version: 5.2.6
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows (zip):
http://snaps.php.net/win32/php5.2-win32-latest.zip
For Windows (installer):
http://snaps.php.net/win32/php5.2-win32-installer-latest.msi
Previous Comments:
------------------------------------------------------------------------
[2008-09-14 12:12:14] acc_php at riggers dot me dot uk
Description:
------------
strftime() called many times results in increasing memory usage. date()
is OK. This is on Vista x64. PHP 5.1.6 (only version i have at the
moment) on linux does not exhibit the same problem.
Reproduce code:
---------------
<?php
echo "=== strftime() ===\n";
echo "Start: ".memory_get_usage()."\n";
for($i = 0; $i < 10000; $i++ ) {
strftime("%d");
}
echo "End: ".memory_get_usage()."\n\n";
echo "=== date() ===\n";
echo "Start: ".memory_get_usage()."\n";
for($i = 0; $i < 10000; $i++ ) {
date("d");
}
echo "End: ".memory_get_usage()."\n";
?>
Expected result:
----------------
End memory usage for strftime() should be close to Start memory usage.
Actual result:
--------------
C:\php-gtk2>php andy\symftest\strftime.test.php
=== strftime() ===
Start: 54384
End: 119800
=== date() ===
Start: 119800
End: 119768
C:\php-gtk2>php -v
PHP 5.2.6 (cli) (built: May 2 2008 19:37:32)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
C:\php-gtk2>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46075&edit=1
Thread (9 messages)