ID:               16564
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Closed
 Bug Type:         Feature/Change Request
 Operating System: Any
 PHP Version:      4.1.2
 New Comment:

If you build PHP with --enable-memory-limit then PHP will write the
peak memory usage of the script to the "mod_php_memory_usage" Apache
note.  You can then have this logged in your Apache log file by adding
{mod_php_memory_usage}n to your log format string.


Previous Comments:
------------------------------------------------------------------------

[2002-04-12 06:51:14] [EMAIL PROTECTED]

I'm developing code libraries for use in web projects. Its important
that the code be memory effecient, but there is no way to track this
currently.

The way php handles objects and arrays it's hard to know when copies
are being made internally. As I understand it, if you have $a=$b in
your script, if $b is an object or array, its not actually copied. Only
if there was a change in one of the elements through $a, does the the
object get copied and the change applied on the copy.

So it would be very useful to have a function that reports on the
internal memory allocations being made by a script, so we one can track
if excessive copying is being made.

Just returning the size would be good enough. Being able to get it in
categories (ie. resources, arrays, objects, references) would be
fantastic.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=16564&edit=1

Reply via email to