Re: Memory usage

Olivier Nicaise <[email protected]> Fri, 22 Feb 2008 09:30:07 +0100
Newsgroups gmane.comp.apache.mod-layout
Message-ID <[email protected]>
With the same versions of apache, php and mod_layout, I got the same  =

results, and sometimes It makes my server crash due to high memory  =

usage, it isv ery annoying. I put a script on my server which kills  =

apache processes with more than 100 MB to avoid crashes.

Le 22-f=E9vr.-08 =E0 05:36, Con Tassios a =E9crit :

> Further to some emails to this list in Dec 2007 titled "mod_layout 5  =

> memory
> leak", the following PHP code demonstrates how memory usage of  =

> Apache processes
> can increase enormously when mod_layout is used on PHP generated  =

> output.
>
> Apache 2.2.8
> PHP 5.2.5
> mod_layout 5.1 and version from hg.tangent.org
>
> Apache configuration:
>
> AddOutputFilterByType LAYOUT text/html
> LayoutFooter "<p> FOOTER<p>"
> LayoutHeader "<p> HEADER<p>"
>
>
> test1.php:
>
> <html>
> <head>
> </head>
> <body>
> <?  for ($i=3D0; $i<=3D20000; $i++) {
>        printf("[%d]  =

> abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$% =

> %^&*()<br>\n", $i);
>    }
> ?>
> </body>
> </html>
>
>
> Output from the above scripts generated is about 1.6MB.  On my  =

> system, Apache
> process grows to about 1GB after a few accesses of the page.  The  =

> same results
> when PHP is run as an Apache module or run as a CGI.
>
> A plain HTML file containing the same contents as the PHP generated  =

> output,
> shows no increased memory usage in the Apache processes.
>
> _______________________________________________
> Mod_layout mailing list
> [email protected]
> http://lists.tangent.org/mailman/listinfo/mod_layout