Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:6868 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70038 invoked by uid 1010); 8 Jan 2004 18:54:28 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 69975 invoked from network); 8 Jan 2004 18:54:28 -0000 Received: from unknown (HELO smtp1.pp.htv.fi) (212.90.64.119) by pb1.pair.com with SMTP; 8 Jan 2004 18:54:28 -0000 Received: from localhost.localdomain (cs181008.pp.htv.fi [213.243.181.8]) by smtp1.pp.htv.fi (Postfix) with ESMTP id AB8B180667; Thu, 8 Jan 2004 20:54:27 +0200 (EET) Received: from localhost (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.12.10/8.12.10) with ESMTP id i08IsQnN001199; Thu, 8 Jan 2004 20:54:27 +0200 Date: Thu, 8 Jan 2004 20:54:26 +0200 (EET) Reply-To: Jani Taskinen To: Armel FAUVEAU Cc: internals@lists.php.net In-Reply-To: <20040108173747.60938.qmail@pb1.pair.com> Message-ID: References: <20040108173747.60938.qmail@pb1.pair.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] PHP4 vs PHP5 Beta 3 : memory usage From: sniper@iki.fi (Jani Taskinen) I tried your script and couldn't reproduce such big numbers. Plus the memory usage leveled to 54152 bytes after some requests to each apache child. This was with using the latest CVS checkout of PHP 5. --Jani On Thu, 8 Jan 2004, Armel FAUVEAU wrote: >Hi all, > >I wanted to compare the memory usage of PHP4 and PHP5 (Beta 3) on a same >script. And i observed a strange problem. > >So, here is a small test (if you want to reproduce it). > >First, i write a small and short php script. >It just make a simple memory_get_usage() (with a number_format for the >presentation :p) : > >print number_format(memory_get_usage(), 0, ',', ' ').' bytes'; >?> > >Second, i write a small shell script to call 100 times my php script by >HTTP. I used lynx. And i stored the result in a logfile. Here is the code : > >#!/bin/sh >for (( i = 1; i <= 100; i++ )); do > lynx -dump http://localhost/armel/mem.php >> php.log >done > >And here is the result... > >---------------------------------------------------- >With PHP4.3.4 (axps module) : > >armel@omble:~$ cat php.log > 27 232 bytes > > 27 232 bytes >... >... > 27 232 bytes > > 27 232 bytes >---------------------------------------------------- >With PHP5 Beta3 (apxs module too) : > >armel@ombre:~$ cat php.log > 211 952 bytes > > 153 784 bytes > > 108 184 bytes > > 157 680 bytes > > 94 376 bytes > > 107 392 bytes > > 446 888 bytes > > 558 712 bytes >... >... > 107 392 bytes > > 446 888 bytes > > 557 656 bytes > > 211 952 bytes > > 153 784 bytes > > 108 184 bytes > > 157 680 bytes >---------------------------------------------------- > >The result under PHP4 is logical. But under PHP5 Beta 3, i think it's very >very strange. What do you think about this ? Any idea ? Maybe my script can >even be a good system of random pulling :)) > >Regards (and happy new year), > >Armel. > >