php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23455 Memory Leak
Submitted: 2003-05-02 16:11 UTC Modified: 2003-06-05 00:56 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:2 (66.7%)
From: adam at planetzerep dot com Assigned:
Status: No Feedback Package: Apache2 related
PHP Version: 4.3.2RC2 OS: Windows 2000
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2003-05-02 16:11 UTC] adam at planetzerep dot com
I installed Apache 2.0.45 on Windows 2000 SP3, and run apachebench to test... 40,000 requests and no leaks.  I then install PHP 4.3.2RC2 and add these lines to Apache config:

LoadModule php4_module "e:/php4/sapi/php4apache2.dll"
AddType application/x-httpd-php .php

Restart Apache, and then create a PHP file like this:

<?
echo "Test";
?>

Then, re-run apachebench, memory will slowly climb as requests are processed.  More and more memory is used, it doesn't go back down until you restart Apache.

I didn't create a php.ini file -- all settings are at their default.  PHP & Apache are binary versions.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-04 13:06 UTC] iliaa@php.net
Do you have any PHP modules loaded beside the core?
 [2003-05-04 23:36 UTC] adam at planetzerep dot com
I am using the PHP win32 binary download, with no php.ini file.  So, I I have not turned on any additional modules.  

Even if I use the recommended php.ini file, and leave all the modules commented out, there is still a memory leak.
 [2003-05-05 15:07 UTC] moriyoshi@php.net
related to bug #21283
 [2003-05-06 18:42 UTC] adam at planetzerep dot com
This memory leak is not caused by apache "warming up" - I have left apachebench running overnight, and apache will consume all of the memory on the server.
 [2003-05-07 09:16 UTC] moriyoshi@php.net
Try the latest cvs snapshot that will be available on May 07, 2003 16:30 GMT.

 [2003-05-07 23:17 UTC] adam at planetzerep dot com
OK, I downloaded http://snaps.php.net/win32/php4-win32-STABLE-200305071630.zip

It looks like there's still a leak... I ran apachebench:

Apache @ start: 16,988K memory
Apache after 50,000 requests: 30,856K memory
Apache after 100,000 requests: 33,592K memory
Apache after 150,000 requests: 36,336K memory
Apache after 200,000 requests: 39,076K memory

So it seems to be leaking about 56 bytes per request.
 [2003-05-17 22:47 UTC] adam at planetzerep dot com
Is this still being looked at?
 [2003-06-05 00:56 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2005-08-17 00:46 UTC] chernyshevsky at hotmail dot com
In case anyone is wondering, this bug is fixed in PHP 4.3.9. The Apache 2 SAPI module in older versions was simply leaking whatever sent to it.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 14 10:01:33 2024 UTC