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 getting smaller numbers, more like what you guys are reporting so I assume you are using Linux.

Then there is this confusing result:

$ php test.php
first growth: 860
second growth: -12,145,628

That is on 5.2.0 on Linux. to get a -12MB, it had to be that big or bigger to start with at some point. Anyone know what that is about? Passing true to memory_get_usage only clouds things further as I get all 0 for memory growth on all platforms making me think that memory_get_usage() without the true param (>=5.2) is useless.

However, despite all those tests (which you can never trust to show real world perfectly) I changed the script I was writing to use NO vars in strings. It is a script that processes queued items. As long as there are items in the queue, it keeps running. The strings I was building were mostly SQL queries. It is now holding at 11MB and not growing. Before, I was having to kill it after an hour as it would grow to over 100MB of memory and growing. That was all determined by looking at ps. Also, what was taking hours, now only took 15 minutes while I was writing this email. All of this was on Linux. My fear is that Mac OS X is making an issue very obvious that is more subtle on Linux, but does exist. I will see if I can come up with a good example on Linux that makes this more prevelant. It may have to run for an hour, which I understand is not the primary target of PHP. I am a big proponent of that philosophy. But, there is a CLI and I am gonna use it. I would like it to be sane. =)

--

Brian Moon
-------------
http://dealnews.com/
It's good to be cheap =)

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to