Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:6861 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60997 invoked by uid 1010); 8 Jan 2004 17:37:47 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 60970 invoked by uid 1007); 8 Jan 2004 17:37:47 -0000 Message-ID: <20040108173747.60938.qmail@pb1.pair.com> To: internals@lists.php.net Date: Thu, 8 Jan 2004 18:45:21 +0100 Lines: 82 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Posted-By: 212.198.33.173 Subject: PHP4 vs PHP5 Beta 3 : memory usage From: armel.fauveau@globalis-ms.com ("Armel FAUVEAU") 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) : 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.