It sounds like you are globalising some variables and never freeing
them, to start with.  You definitely need to run in strict and keep your
namespaces managed lest you have processes keep variables in Memory.

I've found that setting MaxRequestsPerChild in apache to a reasonable
amount minimises this leakage also: Our application performance actually
improved across the board when we implements MaxRequests... (This
basically kills a child process and restarts it after it serves $x
number of requests: Starting with a fresh memory space and freeing the
old).

-----
Brendan W. McAdams           |   [EMAIL PROTECTED]
Senior Applications Developer | (212) 208-9116
TheMuniCenter, LLC             | www.themunicenter.com

"Always listen to experts. They'll tell you what can't be done, and why.
Then do it."
- Robert A. Heinlein

-----Original Message-----
From: Kurt George Gjerde [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 25, 2001 08:13
To: [EMAIL PROTECTED]
Subject: Apache growing (memory)


Hi,

I recently discovered the following on an Apache/mod_perl server.

I have Apache for win32, ActiveState's Perl and the mod_perl PPM
installed
(on a Windows 2000 Pro OS, but read on anyway ;). All were downloaded
and
installed last week so they are the latest versions.

Each time a page is downloaded the Apache service process claims more
memory. Well, not each time but like for every 20th download the task
manager shows Apache using 20-30K more...

A test showed that reloading the same page 2000 times raised Apaches
memory by approx 1000k.

At first I thought that this was due to some sloppy programming (of
mine)
in my recent mod_perl handler, but not so. When using an empty handler
(just the handler sub shell without any code inside it) the same thing
occurred.

This does not happen when loading non-script files (plain html).

Then I did the same test on an ordinary CGI Perl script (no mod_perl)
and
the same thing happened then as well (so why am I posting this here?!).

Since this is on win32 Apache will continue using the same (sub-)process
until it's restarted (unlike Unix; though it IS possible to set up a
'retirement plan' on win32 as well). My fear is that Apache will end up
using all the RAM...

Does anyone know why this is happening? Is it the win32 build of Apache
or
does this happen on other platforms also?


Thanks,
-Kurt.
__________
kurt george gjerde <[EMAIL PROTECTED]>
dept. of media studies, university of bergen



Reply via email to