You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Paul Lindner <pl...@redhat.com> on 2000/04/20 10:09:04 UTC

Memory usage on reload and graceful -- still broken?

Hello mod_perl'ers.

I don't know if it's just me, but I'm having problems with growing
memory reallocation on a HUP or graceful (USR1) restart.  I've looked
through the mailing list archives and the wonderful guide, but have
come up short of answers.

First off, the config:

  Red Hat apache 1.3.12 rpm with mod_perl 1.22 (same spec file as used
  for 1.21 rpm) Very simple configs..  PerlFreshRestart is off.  No
  weirdness in the error logs, etc.

Now, on to the numbers.  I started a server with a clean config and
slowly added the perl configs, and came up with the following memory
analysis.

No perl configs (numbers are actual/shared memory usage, hup by hup)

  3588/2228 -> 3636/2284 -> 3680/2324 -> 3724/2364 -> 3768/2404 -> 3812/2444

Adding a (very) small Apache::Registry section results in:

  4332/3024 -> 4732/3436 -> 5132/3832 -> 5528/4228 -> 5928/4624 -> 6328/5020

Adding the Apache::ASP section to the server

  7608/6312 -> 9596/8300 ->  11472/10196

Adding a fairly complete startup.pl:

 20112/18468 -> 26296/24640 -> 32480/30808


Let's look at the slimmed down case (c1), the deltas are:
  48 44 44 44 44

Now c2:
  400 400 396 400 400

Ah, linear.

A quick calculation reveals that the amount of non-shared memory
remains constant.

The amount of memory increase seems to be in proportion to the initial
size of the process too.  Seems to me that the process is not freeing
memory as it reinitializes.

Has anyone found a work around?  Please don't ask me to ditch the DSO..

-- 
Paul Lindner
plindner@redhat.com
Red Hat Inc.

Re: Memory usage on reload and graceful -- still broken?

Posted by Paul Lindner <pl...@redhat.com>.
On Fri, Apr 21, 2000 at 11:28:18AM -0700, Joshua Chamas wrote:
> Doug MacEachern wrote:
> > 
> > > I have a static Solaris compilation, and have the same problems
> > > where the parent seems to grow by 1M each HUP.
> > 
> > that's strange, do you have PerlFreshRestart On or some <Perl> sections?
> > otherwise, kill -HUP with a static modperl is a noop.
> 
> You got me!  I have <Perl> sections ... but I didn't know
> it was such a crime.  Pretty bizarre behavior if you ask me.

We don't have <perl> sections and it does still occur.  I will try
with a static version and see if that fixes the problem.

-- 
Paul Lindner
plindner@redhat.com
Red Hat Inc.

Re: Memory usage on reload and graceful -- still broken?

Posted by Doug MacEachern <do...@covalent.net>.
> You got me!  I have <Perl> sections ... but I didn't know
> it was such a crime.  Pretty bizarre behavior if you ask me.

it's not a crime, but if you're running Perl code during restart there's a
strong chance you'll be growing the server size.  i agree 1M is bizarre
though.


Re: Memory usage on reload and graceful -- still broken?

Posted by Joshua Chamas <jo...@chamas.com>.
Doug MacEachern wrote:
> 
> > I have a static Solaris compilation, and have the same problems
> > where the parent seems to grow by 1M each HUP.
> 
> that's strange, do you have PerlFreshRestart On or some <Perl> sections?
> otherwise, kill -HUP with a static modperl is a noop.

You got me!  I have <Perl> sections ... but I didn't know
it was such a crime.  Pretty bizarre behavior if you ask me.

-- Joshua
_________________________________________________________________
Joshua Chamas			        Chamas Enterprises Inc.
NodeWorks >> free web link monitoring	Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051

Re: Memory usage on reload and graceful -- still broken?

Posted by Paul Lindner <pl...@redhat.com>.
On Wed, Apr 26, 2000 at 08:33:07PM -0700, Douglas Leonard wrote:
> I had the same issue on Linux.  My build had mod_perl compiled in static
> but mod_so was also compiled in.  PerlFreshRestart was off, I didn't have
> any <Perl> sections, and no modules were loaded dynamically.  My root
> process would grow by about 1MB each time it was HUPed.  Something about
> mod_so was causing it to grow even though every module used was staticly
> compiled in.
> 
> I tried everything I could think of when compiling to have mod_so compiled
> in without having memory growth problems, but eventually I gave up and
> eliminated it from my build.

I can confirm this behavior.  

apache 1.3.12, mod_perl 1.23, Red Hat Linux 6.2, perl 5.005 (rpm)

Compiling with mod_so, but static mod_perl results in leakage, without
mod_so (totally static) results in no memory leaks.

-- 
Paul Lindner
plindner@redhat.com
Red Hat Inc.

Re: Memory usage on reload and graceful -- still broken?

Posted by "G.W. Haywood" <ge...@www.jubileegroup.co.uk>.
Hi all,

On Thu, 20 Apr 2000, Doug MacEachern wrote:

> > I have a static Solaris compilation, and have the same problems 
> > where the parent seems to grow by 1M each HUP.
> 
> that's strange, do you have PerlFreshRestart On or some <Perl> sections?
> otherwise, kill -HUP with a static modperl is a noop.

I was going to get into this at some stage before family illness took
me almost completely away from work, but since this thread has cropped
up I might as well mention it.  Dunno if it's relevant, but it's
suspicious.

When I do apachectl restart on Linux 2.0.34/libc5/1.3.9/1.21/5.005_03
(static build!) I noticed that for each restart @INC appeared to have
an extra copy of the same element, which is set in the BEGIN block in
startup.pl by a line like `use lib sever_root_relative("lib/perl");'.

Unfortunately this is on my development machine and I am away from my
office because of the family problems so I can't give you much more
than that at present.  I expect to visit my office sometime within the
next week so if you think there is anything that I can send to help
pin this down please let me know and I'll try to oblige.  It's no
sweat to me at all, of course.  I'm not even sure I'm getting @INC
correctly - it's well down on my priorities to check it at present.

73,
Ged.


Re: Memory usage on reload and graceful -- still broken?

Posted by Douglas Leonard <dl...@n2h2.com>.
I had the same issue on Linux.  My build had mod_perl compiled in static
but mod_so was also compiled in.  PerlFreshRestart was off, I didn't have
any <Perl> sections, and no modules were loaded dynamically.  My root
process would grow by about 1MB each time it was HUPed.  Something about
mod_so was causing it to grow even though every module used was staticly
compiled in.

I tried everything I could think of when compiling to have mod_so compiled
in without having memory growth problems, but eventually I gave up and
eliminated it from my build.

<Douglas Leonard>
<dl...@n2h2.com>

On Thu, 20 Apr 2000, Doug MacEachern wrote:

> > I have a static Solaris compilation, and have the same problems 
> > where the parent seems to grow by 1M each HUP.
> 
> that's strange, do you have PerlFreshRestart On or some <Perl> sections?
> otherwise, kill -HUP with a static modperl is a noop.
> 
> 


Re: Memory usage on reload and graceful -- still broken?

Posted by Doug MacEachern <do...@covalent.net>.
> I have a static Solaris compilation, and have the same problems 
> where the parent seems to grow by 1M each HUP.

that's strange, do you have PerlFreshRestart On or some <Perl> sections?
otherwise, kill -HUP with a static modperl is a noop.



Re: Memory usage on reload and graceful -- still broken?

Posted by Joshua Chamas <jo...@chamas.com>.
Paul Lindner wrote:
> 
> Hello mod_perl'ers.
> 
> I don't know if it's just me, but I'm having problems with growing
> memory reallocation on a HUP or graceful (USR1) restart.  I've looked
> through the mailing list archives and the wonderful guide, but have
> come up short of answers.
> 
> First off, the config:
> 
>   Red Hat apache 1.3.12 rpm with mod_perl 1.22 (same spec file as used
>   for 1.21 rpm) Very simple configs..  PerlFreshRestart is off.  No
>   weirdness in the error logs, etc.
> 
> Now, on to the numbers.  I started a server with a clean config and
> slowly added the perl configs, and came up with the following memory
> analysis.
> 
> No perl configs (numbers are actual/shared memory usage, hup by hup)
> 
>   3588/2228 -> 3636/2284 -> 3680/2324 -> 3724/2364 -> 3768/2404 -> 3812/2444
> 

I have a static Solaris compilation, and have the same problems 
where the parent seems to grow by 1M each HUP.  This has caused 
me some problems because I have a monitor that will do a 
graceful if the httpd seems stuck, but I ended up doing a 
cold stop/start every X restarts instead.

Yours is a great analysis, and I look forward to the fruits of
your research.

--Joshua

_________________________________________________________________
Joshua Chamas			        Chamas Enterprises Inc.
NodeWorks >> free web link monitoring	Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051

Re: Memory usage on reload and graceful -- still broken?

Posted by Doug MacEachern <do...@covalent.net>.
On Thu, 20 Apr 2000, Paul Lindner wrote:

> Hello mod_perl'ers.
> 
> I don't know if it's just me, but I'm having problems with growing
> memory reallocation on a HUP or graceful (USR1) restart.  I've looked
> through the mailing list archives and the wonderful guide, but have
> come up short of answers.

dso has only recently become usable with mod_perl.  i'm aware dso and kill
-HUP leak memory, but have not looked into it yet.  a hard
shutdown/startup is the only workaround at the moment.