php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28113 Memory is not freed with apache2handler SAPI
Submitted: 2004-04-23 00:33 UTC Modified: 2004-06-25 15:28 UTC
Votes:6
Avg. Score:4.7 ± 0.7
Reproduced:6 of 6 (100.0%)
Same Version:1 (16.7%)
Same OS:0 (0.0%)
From: magnus@php.net Assigned:
Status: Closed Package: Apache2 related
PHP Version: 5CVS-2004-04-23 (dev) OS: Linux
Private report: No CVE-ID: None
 [2004-04-23 00:33 UTC] magnus@php.net
Description:
------------
PHP does not free the memory it's using during and after a request when using apache2handler SAPI. apache2filter SAPI works fine.

The memory it's using is however reused, but if I would send 500MB data and only have 256MB RAM, the OOM killer would start killing processes and apache when there are no more processes to kill (depending on OOM killer used).

Reproduce code:
---------------
<?php
$string = '';
for ($i = 0; $i < 1024; $i++)
   $string .= 'A';

for ($i = 0; $i < (1024 * 200); $i++) {
   echo $string;
   flush();
}
?>

Expected result:
----------------
Low memory usage

Actual result:
--------------
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 8434 nobody    25   0  284m 238m  52m S  0.0 31.6   0:25.14 httpd


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-21 12:18 UTC] alex dot pagnoni at solarix dot it
I'm experiencing huge memory leaks on Apache1 too.
 [2004-06-25 15:28 UTC] edink@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 23:01:26 2024 UTC