From: Thies C. Arntzen Date: Fri, 11 May 2001 18:17:08 +0000 (+0000) Subject: @- Added --enable-memory-usage-info. This creates a new Apache 1.x logging X-Git-Tag: PRE_GRANULAR_GARBAGE_FIX~483 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=169febcdf0033cfdd051ffe881231dec3eec8b71;p=php @- Added --enable-memory-usage-info. This creates a new Apache 1.x logging @ directive "{mod_php_memory_usage}n" which will log the peak amount of @ memory used by the script. (Thies) --- diff --git a/sapi/apache/mod_php4.c b/sapi/apache/mod_php4.c index 13af96edee..54aea59e6e 100644 --- a/sapi/apache/mod_php4.c +++ b/sapi/apache/mod_php4.c @@ -540,7 +540,19 @@ static int send_php(request_rec *r, int display_source_mode, char *filename) static int send_parsed_php(request_rec * r) { - return send_php(r, 0, NULL); + int result = send_php(r, 0, NULL); + +#if MEMORY_USAGE_INFO + { + char mem_usage[ 32 ]; + ALS_FETCH() + + sprintf(mem_usage,"%u", (int) AG(max_allocated_memory)); + ap_table_setn(r->notes, "mod_php_memory_usage", ap_pstrdup(r->pool,mem_usage)); + } +#endif + + return result; }