Using the new memory manager in PHP5.2


What’s new in PHP V5.2, Part 1: Using the new memory manager

In addition to making the memory manager more flexible and transparent, PHP V5.2 provides a new parameter for memory_get_usage() and memory_get_peak_usage(), which allow the viewing of the amount of used memory. The new Boolean mentioned in the notes is real_size. By invoking the function memory_get_usage($real); where $real = true, the result will be the real size of memory allocated from the system, including the memory-manager overhead, at the moment of invocation. Without the flag set, the data returned would be only the memory used within the running script, minus the memory-manager overhead.

Related Posts