ID: 41713
Comment by: idvis at seznam dot cz
Reported By: mplomer at gmx dot de
Status: Open
Bug Type: Performance problem
Operating System: win32 only
PHP Version: 5.2.4-dev 2007-06-26 00:09
New Comment:
I have very similar problem - I use Apache 2.2.3 with isapi php 5.2.1
on Win2000Pro. After executing a few more complicated php scripts,
httpd.exe consumes abnormal memory size - up to 300MB.
Previous Comments:
------------------------------------------------------------------------
[2007-07-11 08:43:55] mplomer at gmx dot de
I tested with PHP 5.2.0 now, and I can reproduce the described
behaviour from [30 Jun 10:19am UTC] too. Only when I am testing with PHP
5.1.6, I can't reproduce it.
But I agree with you, that this points at the new memory management on
win32.
------------------------------------------------------------------------
[2007-07-10 23:39:09] spamtrap at psychoticwolf dot net
I see this with PHP 5.2.1 - 5.2.3 (mod_php5 with Apache 2.0.59 and
2.2.4 on WinXP and Win2003). I did some regression testing and it seems
to have started between 5.2.0 and 5.2.1 which points at the new memory
management on win32. Memload was normal under 5.2.0. After awhile,
Apache consumes as previously reported, 300-600mb (usually around 330mb
+ 6-700mb virtual), and, curiously, PHP thows a Fatal Error that its
exceeded its memory limit for that script, even though it hasn't, as the
script doesn't use more than about 300k. (Only seen this last part once,
so far, so that might be a fluke.)
------------------------------------------------------------------------
[2007-07-09 13:48:22] mplomer at gmx dot de
Does somebody have any ideas to track this down?
Are there any PHP core developers with a windows-test-environment?
Aren't there any PHP developers who have the problem, that Apache/PHP
eats up all RAM after some hours of developing and testing bigger
PHP-projects?
------------------------------------------------------------------------
[2007-06-30 11:32:59] mplomer at gmx dot de
Another developer tested this on his own machine now, with the same
Apache/PHP environment, and could affirm this behavior. The memory usage
values are respectively 0,1-0,3 MB different, but the principle is the
same. So the behavior seems not to be system dependent.
------------------------------------------------------------------------
[2007-06-30 10:19:26] mplomer at gmx dot de
OK, it took me some time to get FastCGI running, but now it works,
and yes ... I can reproduce it there, too.
To be more detailed, I set up the following environment:
- Apache 2.0.59 (minimalistic configuration) with
mod_fastcgi-SNAP-0404142202-AP2.dll
- Configured FastCGI with 1 process:
FastCgiServer ../php5/php-cgi.exe -processes 1
- PHP 5.2.3 (without php.ini; only php-cgi.exe and php5ts.dll)
- and the test-script with 400,000 array elements:
<?php
$elementCount = 400000;
for ($i = 0; $i < $elementCount; $i++) {
$variables[$i] = 'x';
}
?>
Reproducing by looking at the Task-Manager's memory usage
values after each execution of the script:
- Freshly starting Apache
- Child process "php-cgi.exe" is started
[php-cgi.exe consumes ~ 4.1 MB]
- Execute the test-script the first time:
[php-cgi.exe consumes ~ 4.8 MB]
- Execute one more time: [php-cgi.exe consumes ~ 4.8 MB]
- Execute one more time: [php-cgi.exe consumes ~ 5.3 MB]
... might be OK so long
- Execute one more time: [php-cgi.exe consumes ~ 36.4 MB !!!]
... from now on this is not OK anymore
- Execute one more time: [php-cgi.exe consumes ~ 36.7 MB]
- Execute one more time: [php-cgi.exe consumes ~ 6.1 MB]
- Execute one more time: [php-cgi.exe consumes ~ 36.4 MB]
- Execute one more time: [php-cgi.exe consumes ~ 36.5 MB]
- Execute one more time: [php-cgi.exe consumes ~ 7.7 MB]
- Execute one more time: [php-cgi.exe consumes ~ 36.7 MB]
- Execute one more time: [php-cgi.exe consumes ~ 36.8 MB]
- Execute one more time: [php-cgi.exe consumes ~ 5.8 MB]
- Execute one more time: [php-cgi.exe consumes ~ 36.4 MB]
- Execute one more time: [php-cgi.exe consumes ~ 36.5 MB]
- Execute one more time: [php-cgi.exe consumes ~ 10.6 MB]
- Execute one more time: [php-cgi.exe consumes ~ 36.7 MB]
- Execute one more time: [php-cgi.exe consumes ~ 36.8 MB]
- Execute one more time: [php-cgi.exe consumes ~ 5.5 MB]
- ...
This is always reproducable, and the memory usage values
are quite the same on each reproducion. (They differ only
sometimes in 4-12 KB.)
But you see, there is a systematic. There are 2 executions,
after which the memory is not freed, and after the third
execution, the memory is mostly freed.
Any ideas for further testing?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/41713
--
Edit this bug report at http://bugs.php.net/?id=41713&edit=1