|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-03-13 20:54 UTC] mberg at synacor dot com
Description: ------------ The fix for bug #35646 results in mod_php_memory_usage always being set to 0. The proper fix seems to already be implemented in the Apache 1.x handler, so it should just be a matter of rolling back the broken fix and copying the right one into the apache2handler. <pre> diff -u2 -r php-4.4.2.orig/Zend/zend_alloc.c php-4.4.2/Zend/zend_alloc.c --- php-4.4.2.orig/Zend/zend_alloc.c Sun Jan 1 08:46:49 2006 +++ php-4.4.2/Zend/zend_alloc.c Fri Mar 10 16:59:18 2006 @@ -539,5 +539,4 @@ #if MEMORY_LIMIT AG(memory_exhausted)=0; - AG(allocated_memory_peak) = 0; #endif diff -u2 -r php-4.4.2.orig/sapi/apache2handler/sapi_apache2.c php-4.4.2/sapi/apache2handler/sapi_apache2.c --- php-4.4.2.orig/sapi/apache2handler/sapi_apache2.c Sun Jan 1 08:47:01 2006 +++ php-4.4.2/sapi/apache2handler/sapi_apache2.c Mon Mar 13 14:47:52 2006 @@ -588,4 +588,5 @@ mem_usage = apr_psprintf(ctx->r->pool, "%u", AG(allocated_memory_peak)); + AG(allocated_memory_peak) = 0; apr_table_set(r->notes, "mod_php_memory_usage", mem_usage); </pre> PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 00:00:01 2025 UTC |
We're always getting a value of 0 logged for %{mod_php_memory_usage} using stock 4.4.2 with Apache 1.3.34. It worked as expected with 4.3.11. Reverting the change introduced in bug #35646 with the following patch fixed it for us: --- php-4.4.2.orig/Zend/zend_alloc.c Sun Jan 1 08:46:49 2006 +++ php-4.4.2/Zend/zend_alloc.c Fri Mar 10 16:59:18 2006 @@ -541 +540,0 @@ - AG(allocated_memory_peak) = 0; This presumably breaks Apache 2.x though (_that_ I haven't tested), which is where the second part of my suggested fix comes in. This is just clearing the value in the bit of code in apache2handler that's analagous to where it was cleared in mod_php4.c.