Now, functions memory_get_[peak_]usage() and memory_limit checking can be enabled/disabled using "--enable-memory-limit" configure option. However cost of meory_limit checking is significant less with new memory manager. I think now we can remove "--enable-memory-limit" option and make it always enabled. Functions memory_get_[peak_]usage() will be always enabled and will always report proper values for "real" memory usage. The tracking of "emalloced" memory usage will be enabled only in DEBUG build. So in RELEASE memory_get_[peak_]usage() and memory_get_[peak_]usage(false) will always return FALSE (or 0), and memory_get_[peak_]usage(true) will return "real" memory usage. In DEBUG build memory_get_[peak_]usage() and memory_get_[peak_]usage(false) will return "emalloced" memory, and memory_get_[peak_]usage(true) will return "real" memory usage. What do you think? Dmitry.
-----Original Message----- From: Ilia Alshanetsky [mailto:[EMAIL PROTECTED] On Behalf Of Ilia Alshanetsky Sent: Thursday, July 27, 2006 4:35 PM To: Matt W Cc: internals@lists.php.net; Dmitry Stogov Subject: Re: [PHP-DEV] memory_get_usage with new Memory Manager On 27-Jul-06, at 6:02 AM, Matt W wrote: Something else I'd like to see changed... Does anyone think memory_get_[peak_]usage() should *always* be available, regardless of whether memory_limit is actually enabled? Using the Windows binaries at least, I was devastated :-D that they were unavailable for experimenting, etc. Counting memory all the time adds a fair amount of overhead to script execution especially given how frequently PHP needs to allocate memory. Therefore usage memory utilization functions are only available when PHP is compiled with memory in which case it keeps track of its mem usage. Ilia Alshanetsky