memory_get_peak_usage()
Use this function to find out how the peak memory that was allocated by PHP. This function may not work properly (if at all) on non Unix-like systems.
By default, only the memory used by emalloc() is reported. To get the real size of memory allocated from system, pass in the value TRUE (as of PHP 5.2.0).
// These numbers are only for example, of course memory_get_peak_usage(); // 347768 memory_get_peak_usage( true ); // 524288
See the manual entry for memory_get_peak_usage()
