From:             vovik at getart dot ru
Operating system: RHEL 4
PHP version:      4.4.1
PHP Bug Type:     Apache2 related
Bug description:  %{mod_php_memory_usage}n doesn't refreshed after exit due to 
memory_limit

Description:
------------
I using 'LogFormat "%h %l %u %t \"%r\" %>s %b
php(%{mod_php_memory_usage}n)" common' in httpd.conf for logging php
memory usage.

If php script exited on fatal error due to memory limitation,
%{mod_php_memory_usage}n keeps high value for all following requests to
this apache child.

Reproduce code:
---------------
if (@$_GET["test"] == 1) {
    print "Allocated: ".memory_get_usage();

} else {
    ini_set("memory_limit", 1048576 * 100); // 100K

    // PHP exited in file_get_contents with message:
    // PHP Fatal error:  Allowed memory size of 104857600 bytes exhausted
    $bigfile = file_get_contents("/etc/termcap"); // this file is about
800K on my host
}

First, run this script without parameter, next with ?test=1. Check apache
log then.

Expected result:
----------------
[12/Dec/2005:13:28:47 +0000] "GET /test.php HTTP/1.1" 200 - php(806944)
[12/Dec/2005:13:28:57 +0000] "GET /test.php?test=1 HTTP/1.1" 200 16
php(*****) // not the same as previous, should be much lower

Actual result:
--------------
[12/Dec/2005:13:28:47 +0000] "GET /test.php HTTP/1.1" 200 - php(806944)
[12/Dec/2005:13:28:57 +0000] "GET /test.php?test=1 HTTP/1.1" 200 16
php(806944)

-- 
Edit bug report at http://bugs.php.net/?id=35646&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=35646&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=35646&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=35646&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=35646&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=35646&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=35646&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=35646&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=35646&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=35646&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=35646&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=35646&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=35646&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=35646&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=35646&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=35646&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=35646&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=35646&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=35646&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=35646&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=35646&r=mysqlcfg

Reply via email to