Page 1 of 1

Object Memory Usage

Posted: Thu Jun 03, 2004 10:53 am
by daven
*waves* Hello all. Back again after my hiatus from PHP. Now on to my issue:

I am debugging an application which has hundreds (and theoretically thousands) of objects floating about. I would like to be able to determine the amount of memory the objects are consuming. ie -- memory_use($foo) returns the number of bytes $foo uses.

Any clues as to how to accomplish this?

Note:
Using PHP 4.*, primarily 4.3.* (the version varies across different boxes)

Thanks

Posted: Thu Jun 03, 2004 11:31 am
by launchcode
memory_get_usage() will show it on a script level. I believe that is as low as you can go without a decent code profiler like the one that ships with Zend Studio.