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) :

<?php
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) :

[EMAIL PROTECTED]:~$ cat php.log
   27 232 bytes

   27 232 bytes
...
...
   27 232 bytes

   27 232 bytes
----------------------------------------------------
With PHP5 Beta3 (apxs module too) :

[EMAIL PROTECTED]:~$ 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.

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

Reply via email to