Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:28255 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23278 invoked by uid 1010); 5 Mar 2007 23:33:56 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 23263 invoked from network); 5 Mar 2007 23:33:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Mar 2007 23:33:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=brianm@dealnews.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=brianm@dealnews.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain dealnews.com designates 129.41.69.185 as permitted sender) X-PHP-List-Original-Sender: brianm@dealnews.com X-Host-Fingerprint: 129.41.69.185 smtp.dealnews.com Linux 2.5 (sometimes 2.4) (4) Received: from [129.41.69.185] ([129.41.69.185:53285] helo=smtp.dealnews.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 51/49-16561-3E8ACE54 for ; Mon, 05 Mar 2007 18:33:56 -0500 Received: (qmail 5439 invoked from network); 5 Mar 2007 18:33:53 -0500 Received: from unknown (HELO mail.dealnews.com) (10.1.1.7) by -H with (DHE-RSA-AES256-SHA encrypted) SMTP; 5 Mar 2007 18:33:53 -0500 Received: (qmail 28900 invoked from network); 5 Mar 2007 18:33:53 -0500 Received: from unknown (HELO ?10.1.6.4?) (brianm@71.31.236.178) by -H with ESMTPA; 5 Mar 2007 18:33:53 -0500 Message-ID: <45ECA8D7.6060804@dealnews.com> Date: Mon, 05 Mar 2007 17:33:43 -0600 User-Agent: Thunderbird 2.0b2 (Macintosh/20070116) MIME-Version: 1.0 To: Rasmus Lerdorf CC: internals@lists.php.net References: <45EC8CE9.8020807@dealnews.com> <45EC9D1B.6000804@zend.com> <45EC9FAF.2080005@dealnews.com> <45ECA114.3080402@lerdorf.com> In-Reply-To: <45ECA114.3080402@lerdorf.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] The way the engine works? From: brianm@dealnews.com (Brian Moon) 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 =)