Re: Confusion resolved (was: mod_perl DSO leaking on restart)

2001-06-19 Thread Doug MacEachern

On 19 Jun 2001, Vivek Khera wrote:
 
> Drat.  Not here.  I just sucked down the latest mod_perl CVS with this
> patch, and I still lose 9M per USR1...  Lemme try some tracing to see
> what gives here.  (FreeBSD 4.3, perl 5.005_03)

i mentioned earlier in the thread 5.005_03 has leaks.  although, with the
t/ config (make start_httpd_fork), i see ~140k of leakage per USR1,
compared to 9M is a surprise, but i suppose the 5.005_03 leakage depends
on what you have loaded.





Re: Confusion resolved (was: mod_perl DSO leaking on restart)

2001-06-19 Thread Vivek Khera

> "DM" == Doug MacEachern <[EMAIL PROTECTED]> writes:

DM> On 19 Jun 2001, Vivek Khera wrote:
>> Drat.  Not here.  I just sucked down the latest mod_perl CVS with this
>> patch, and I still lose 9M per USR1...  Lemme try some tracing to see
>> what gives here.  (FreeBSD 4.3, perl 5.005_03)

DM> i mentioned earlier in the thread 5.005_03 has leaks.  although, with the
DM> t/ config (make start_httpd_fork), i see ~140k of leakage per USR1,

Right.  Apparently the size of Volvo semi-trucks.  I guess I'll just
not USR1 the back-end ;-)





RE: Confusion resolved (was: mod_perl DSO leaking on restart)

2001-06-19 Thread Doug MacEachern

On Tue, 19 Jun 2001, Christian Gilmore wrote:

> Doug,
> 
> Will this patch make it into 1.26?

yes.

> If so, is there a slated release date for 1.26?

soon-ish.  you can always configure: PerlSetEnv PERL_DESTRUCT_LEVEL 2
in the meantime.




RE: Confusion resolved (was: mod_perl DSO leaking on restart)

2001-06-19 Thread Christian Gilmore

Doug,

Will this patch make it into 1.26? If so, is there a slated release date
for 1.26?

Thanks,
Christian

> -Original Message-
> From: Doug MacEachern [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 18, 2001 9:04 PM
> To: Paul G. Weiss
> Cc: mod_perl list
> Subject: Re: Confusion resolved (was: mod_perl DSO leaking on restart)
>
>
> ah ha, right, since i always have PERL_DEBUG=1, perl_destruct_level is
> always set to 2.  good find!  it should always be 2 for dso,
> this patch
> seems to fix USE_APXS too.
>
> --- src/modules/perl/mod_perl.c 2001/06/14 04:49:08 1.137
> +++ src/modules/perl/mod_perl.c 2001/06/19 01:59:18
> @@ -259,8 +259,6 @@
>
>  if((pdl = getenv("PERL_DESTRUCT_LEVEL")))
> perl_destruct_level = atoi(pdl);
> -else
> -   perl_destruct_level = PERL_DESTRUCT_LEVEL;
>
>  if(perl_destruct_level < 0) {
> MP_TRACE_g(fprintf(stderr,
> @@ -510,6 +508,7 @@
>  array_header *librefs;
>
>  librefs = xs_dl_librefs((pool *)data);
> +perl_destruct_level = 2;
>  perl_shutdown(NULL, NULL);
>  unload_xs_so(librefs);
>  }
>
>
>
>




Re: Confusion resolved (was: mod_perl DSO leaking on restart)

2001-06-18 Thread Doug MacEachern

ah ha, right, since i always have PERL_DEBUG=1, perl_destruct_level is
always set to 2.  good find!  it should always be 2 for dso, this patch
seems to fix USE_APXS too.

--- src/modules/perl/mod_perl.c 2001/06/14 04:49:08 1.137
+++ src/modules/perl/mod_perl.c 2001/06/19 01:59:18
@@ -259,8 +259,6 @@
 
 if((pdl = getenv("PERL_DESTRUCT_LEVEL")))
perl_destruct_level = atoi(pdl);
-else
-   perl_destruct_level = PERL_DESTRUCT_LEVEL;
 
 if(perl_destruct_level < 0) {
MP_TRACE_g(fprintf(stderr, 
@@ -510,6 +508,7 @@
 array_header *librefs;
 
 librefs = xs_dl_librefs((pool *)data);
+perl_destruct_level = 2;
 perl_shutdown(NULL, NULL);
 unload_xs_so(librefs);
 } 






Confusion resolved (was: mod_perl DSO leaking on restart)

2001-06-18 Thread Paul G. Weiss

I think I've found the error of my ways.

The reason that it was leaking with a static build was that the
PerlFreshRestart directive was set to 'On'.  This resulted in a
leak of a couple of Mb.

The reason that it was leaking with a USE_DSO build was that I didn't set
PERL_DESTRUCT_LEVEL.  Once I added
PerlSetEnv PERL_DESTRUCT_LEVEL 2
the leak stopped.  Actually I get the behavior Doug reported: a small leak
of around 24K on the first restart and none thereafter.

Actually in order to achieve this I had to comment out the load of
example_module.  That module leaks about 56K when restarted as a dso.

I've not been able to avoid a leak with a USE_APXS build.

-Paul



On Sun, 17 Jun 2001, Paul G. Weiss wrote:

> Now I'm really confused.  I built the whole thing statically and it still
> leaks:
> 
> the static build (using the same Perl):
> 
> ~/test/prefix/bin/perl Makefile.PL EVERYTHING=1 \
> APACHE_PREFIX=$(echo ~/test/prefix/apache) \
> APACHE_SRC=../apache_1.3.19 DO_HTTPD=1
> 
> Now it still leaks 520K per restart:
> 
> > make start_httpd_fork
> ../apache_1.3.19/src/httpd -f `pwd`/t/conf/httpd.conf -d `pwd`/t
> > ps -o pid,vsz,comm -p $(cat t/logs/httpd.pid )
>   PID   VSZ COMMAND
>  4877  7856 httpd
> > kill -USR1  $(cat t/logs/httpd.pid )
> > ps -o pid,vsz,comm -p $(cat t/logs/httpd.pid )
>   PID   VSZ COMMAND
>  4877  8488 httpd
> > kill -USR1  $(cat t/logs/httpd.pid )
> > ps -o pid,vsz,comm -p $(cat t/logs/httpd.pid )
>   PID   VSZ COMMAND
>  4877  9108 httpd
> 
> This is on Redhat 7.1 (not Linux 7.1 as I said below).  I didn't bother
> trying it on Solaris.
> 
> You don't suppose building with APACHE_PREFIX could have anything to do
> with it, do you?  I haven't heard of any leaks with a static build.
> 
> -P
> 
> 
> 
> 
> 
> 
> On Sun, 17 Jun 2001, Paul G. Weiss wrote:
> 
> > Doug,
> > 
> > I'm confused as to how you managed to *not* leak when I'm still
> > leaking.  I've tried these tests on both a Solaris 2.7 system and
> > a Linux 7.1.
> > 
> > Here is a summary of what I do:
> > 
> > I build Perl
> > 
> > ./Configure -des -Uusemymalloc -Dprefix=$(echo ~/test/prefix) -Dcc=gcc
> > make && make test && make install
> > 
> > I build Apache
> > 
> > ~/test/prefix/bin/perl Makefile.PL USE_DSO=1 EVERYTHING=1 \
> > USE_APACI=1 APACHE_PREFIX=$(echo ~/test/prefix/apache) \
> > APACHE_SRC=../apache_1.3.19 \
> > APACI_ARGS='--enable-module=all --enable-shared=max' \
> > DO_HTTPD=1
> > 
> > make
> > make test
> > 
> > I now run the test:
> > 
> > make start_httpd_fork
> > ps -o 'pid,vsz,comm' -p $(cat t/logs/httpd.pid )
> > kill -USR1 $(cat t/logs/httpd.pid )
> > ps -o 'pid,vsz,comm' -p $(cat t/logs/httpd.pid )
> > kill -USR1 $(cat t/logs/httpd.pid )
> > 
> > etc.  The virtual size grows each time, although by different amounts 
> > in Linux and Solaris.  Both are around 4Mb.  So what are you doing 
> > differently?  Let me know so I can do the same thing.  The Perl I'm using
> > is 5.6.1 and the modperl is
> > modperl_20010614113010.tar.gz.
> > 
> > -P
> > 
> > 
> > On Fri, 15 Jun 2001, Paul G. Weiss wrote:
> > 
> > > Don't be so willing to bet.  Still leaking.
> > > 
> > > I did as you said and just rebuilt Perl and mod_perl but didn't bother to
> > > rebuild all the Perl modules (I would have done so had I been successful
> > > here).
> > > 
> > > Here's what I see:
> > > 
> > > > make start_httpd_fork
> > > ../apache_1.3.19/src/httpd -f `pwd`/t/conf/httpd.conf -d `pwd`/t
> > > > ps -o 'pid,ppid,vsz,comm' -p $(cat t/logs/httpd.pid )
> > >   PID  PPID  VSZ COMMAND
> > > 28802 1 15528 ../apache_1.3.19/src/httpd
> > > > kill -USR1 $(cat t/logs/httpd.pid )
> > > > ps -o 'pid,ppid,vsz,comm' -p $(cat t/logs/httpd.pid )
> > >   PID  PPID  VSZ COMMAND
> > > 28802 1 20016 ../apache_1.3.19/src/httpd
> > > > kill -USR1 $(cat t/logs/httpd.pid )
> > > > ps -o 'pid,ppid,vsz,comm' -p $(cat t/logs/httpd.pid )
> > >   PID  PPID  VSZ COMMAND
> > > 28802 1 24544 ../apache_1.3.19/src/httpd
> > > > kill -USR1 $(cat t/logs/httpd.pid )
> > > > ps -o 'pid,ppid,vsz,comm' -p $(cat t/logs/httpd.pid )
> > >   PID  PPID  VSZ COMMAND
> > > 28802 1 27224 ../apache_1.3.19/src/httpd
> > > > make kill_httpd
> > > kill `cat t/logs/httpd.pid`
> > > rm -f t/logs/httpd.pid
> > > rm -f t/logs/error_log
> > > 
> > > 
> > > 
> > > On Thu, 14 Jun 2001, Doug MacEachern wrote:
> > > 
> > > > On Fri, 15 Jun 2001, Paul G. Weiss wrote:
> > > > 
> > > > > alignbytes=8, usemymalloc=y, prototype=define
> > > > ^
> > > > ok, here's why i kept asking for perl -V.  i don't see Perl's malloc.c
> > > > ever release its memory pool.  when usemymalloc=y, free() only puts memory
> > > > back into Perl's pool for use by other malloc()'s.  i don't see a function
> > > > to destroy this pool when perl cleans itself up.  willing to bet if you
> > > > rebuild Perl with: Configure -des -Uusemymalloc ...
> > > > and then rebuild mod_perl, the leaks will go away.
> > > > 
> > > 
> > 
> > 
> >