Ok, I am no C coder and I don't claim to be very smart about low level
parts of PHP. But, IMO, this is bug.
http://bugs.php.net/bug.php?id=36924
I have created a test script that shows the insanity of this bug:
?php
$str = This is a medium length string;
$start = memory_get_usage();
On 03/06/2007 12:34 AM, Brian Moon wrote:
Ok, I am no C coder and I don't claim to be very smart about low level
parts of PHP. But, IMO, this is bug.
http://bugs.php.net/bug.php?id=36924
I have created a test script that shows the insanity of this bug:
?php
$str = This is a medium length
Antony Dovgal wrote:
Yup, the language stole ~32Kb of your memory and used it to speedup the
allocation of small chunks.
Ok, in my attempt to send a sane looking example, I cleaned up the problem.
?php
$str = This is a medium length string;
$start = memory_get_usage();
The introduction of $x into the string makes the difference.
first growth: 892
second growth: 3,955,068
Strange, I get:
first growth: 820
second growth: 56
Which build did you test?
--
Stanislav Malyshev, Zend Products Engineer
[EMAIL PROTECTED] http://www.zend.com/
--
PHP Internals - PHP
Brian Moon wrote:
Antony Dovgal wrote:
Yup, the language stole ~32Kb of your memory and used it to speedup
the allocation of small chunks.
Ok, in my attempt to send a sane looking example, I cleaned up the problem.
?php
$str = This is a medium length string;
$start =
I think what is happening is that the Engine caches small-sized memory
blocks and does not really free them when they are deallocated, even
when they are not referenced anymore. The cache size is limited, so I
don't think you need to be concerned. If you still think it is a big
problem for
Rasmus Lerdorf wrote:
I get:
first growth: 704
second growth: 32,264
with current PHP_5_2 checkout. I don't have a 5.1.x handy with memory
limits compiled in.
Starting to think this is more prevelant on Mac OS X. My huge numbers
are coming from 5.2.0, on Mac OS X. On my Linux boxes I am
Brian Moon wrote:
Rasmus Lerdorf wrote:
I get:
first growth: 704
second growth: 32,264
with current PHP_5_2 checkout. I don't have a 5.1.x handy with memory
limits compiled in.
Starting to think this is more prevelant on Mac OS X. My huge numbers
are coming from 5.2.0, on Mac OS X.
Starting to think this is more prevelant on Mac OS X. My huge numbers
are coming from 5.2.0, on Mac OS X. On my Linux boxes I am getting
smaller numbers, more like what you guys are reporting so I assume you
are using Linux.
I vaguely remember there was some problem with calculating exact
On 03/06/2007 02:33 AM, Brian Moon wrote:
Rasmus Lerdorf wrote:
I get:
first growth: 704
second growth: 32,264
with current PHP_5_2 checkout. I don't have a 5.1.x handy with memory
limits compiled in.
Starting to think this is more prevelant on Mac OS X. My huge numbers
are coming from
10 matches
Mail list logo