#39652 [NEW]: memory_get_usage() Bug
| From: | chris at dented-planet dot net | Date: | Tue, 28 Nov 2006 00:08:47 +0000 |
| Subject: | #39652 [NEW]: memory_get_usage() Bug | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-105509@lists.php.net to get a copy of this message | ||
From: chris at dented-planet dot net
Operating system: Mac OS X 10.4.8
PHP version: 5.2.0
PHP Bug Type: Unknown/Other Function
Bug description: memory_get_usage() Bug
Description:
------------
I don't know if it's utf8_encode() or memory_get_usage() in the following
script that might be causing the issue. But rather quickly in the loop,
memory_get_usage() begins to report a steadily decreasing amount of memory
used until it drops into negative values.
A graph of usage is at: http://dented-planet.net/graph.png
'memory_limit' is set to 100MB in php.ini.
I know this isn't the best possible bug report, but I'm not sure how else
to report it.
Reproduce code:
---------------
<?php
$x = '';
for ($i = 1; $i <= 20000; $i++) {
$x = utf8_encode('this is a test');
if ($i % 100 === 0) {
echo $i . ' ' . memory_get_usage() . ' ' . memory_get_usage(true)
. "\n";
}
}
?>
--
Edit bug report at http://bugs.php.net/?id=39652&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39652&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39652&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39652&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=39652&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=39652&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=39652&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=39652&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=39652&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=39652&r=support
Expected behavior: http://bugs.php.net/fix.php?id=39652&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=39652&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=39652&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=39652&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39652&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=39652&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=39652&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=39652&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=39652&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=39652&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=39652&r=mysqlcfg