Re: What causes memory leaks during graceful restarts?

2002-06-13 Thread Vivek Khera

 DM == Doug MacEachern [EMAIL PROTECTED] writes:

DM what version of perl?  what modperl Makefile.PL options?
DM if you're using modperl as a dso, you'll need at least perl 5.6.1 and 
DM modperl-1.26 to prevent this leakage on restarts.

Even with these versions, I get massive leakage on restart with
FreeBSD.  I always do a stop/start now.


-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.Khera Communications, Inc.
Internet: [EMAIL PROTECTED]   Rockville, MD   +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/



Re: What causes memory leaks during graceful restarts?

2002-05-22 Thread Dan Wilga

At 6:56 PM -0700 5/21/02, Doug MacEachern wrote:
On Tue, 21 May 2002, Dan Wilga wrote:

  I am using Perl 5.6.1, modperl 1.25, and yes it's a DSO. It's compiled with:

with 1.25, you can also set the PERL_DESTRUCT_LEVEL environment variable
to 2, either before starting the server:

export PERL_DESTRUCT_LEVEL=2
apachectl start

or using PerlSetEnv in httpd.conf

the fix in modperl-1.26 is simply to use that value by default.

Interesting. When I do that, I get the same problem I did when I 
tried to run with 1.25_01 and 1.26: Apache core dumps. I think I'll 
have to try compiling it again with the latest version of mod_perl, 
and perhaps not as a DSO.


Dan Wilga [EMAIL PROTECTED]
Web Technology Specialist http://www.mtholyoke.edu
Mount Holyoke CollegeTel: 413-538-3027
South Hadley, MA  01075Seduced by the chocolate side of the Force




Re: What causes memory leaks during graceful restarts?

2002-05-22 Thread Doug MacEachern

On Wed, 22 May 2002, Dan Wilga wrote:
 
 Interesting. When I do that, I get the same problem I did when I 
 tried to run with 1.25_01 and 1.26: Apache core dumps. I think I'll 
 have to try compiling it again with the latest version of mod_perl, 
 and perhaps not as a DSO.

possible that your are hitting the XSLoader vs. DynaLoader problem, where 
the list of dlhandles can be wiped out.  try adding 'use DynaLoader ();' 
to your startup.pl before any other module is loaded.




Re: What causes memory leaks during graceful restarts?

2002-05-22 Thread Dan Wilga

At 8:41 AM -0700 5/22/02, Doug MacEachern wrote:
On Wed, 22 May 2002, Dan Wilga wrote:

  Interesting. When I do that, I get the same problem I did when I
  tried to run with 1.25_01 and 1.26: Apache core dumps. I think I'll
  have to try compiling it again with the latest version of mod_perl,
  and perhaps not as a DSO.

possible that your are hitting the XSLoader vs. DynaLoader problem, where
the list of dlhandles can be wiped out.  try adding 'use DynaLoader ();'
to your startup.pl before any other module is loaded.

Oh ho! That's it. Now when I gracefully restart, the memory loss is 
only about 29 Kb -- a very reasonable number.

So if that's the reason for the core dump, is there a bug fix to the 
offending module in the works?


Dan Wilga [EMAIL PROTECTED]
Web Technology Specialist http://www.mtholyoke.edu
Mount Holyoke CollegeTel: 413-538-3027
South Hadley, MA  01075Got Perl?




Re: What causes memory leaks during graceful restarts?

2002-05-22 Thread Doug MacEachern

On Wed, 22 May 2002, Dan Wilga wrote:
 
 Oh ho! That's it. Now when I gracefully restart, the memory loss is 
 only about 29 Kb -- a very reasonable number.

much better.  with the modperl test suite, i only see a wee bit of leakage 
on the first restart, then no leakage on restarts after that.
 
 So if that's the reason for the core dump, is there a bug fix to the 
 offending module in the works?

it is fixed in 5.8.0-tobe with the patch below, which can also be applied 
to 5.6.1

Index: ext/DynaLoader/DynaLoader_pm.PL
===
RCS file: 
/usr/local/cvs_repository/perl-current-mirror/ext/DynaLoader/DynaLoader_pm.PL,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 DynaLoader_pm.PL
--- ext/DynaLoader/DynaLoader_pm.PL 2001/01/04 01:55:35 1.1.1.1
+++ ext/DynaLoader/DynaLoader_pm.PL 2001/06/19 05:10:22
 -80,8 +80,10 
 dl_require_symbols = ();   # names of symbols we need
 dl_resolve_using   = ();   # names of files to link with
 dl_library_path= ();   # path to look for files
-@dl_librefs = ();   # things we have loaded
-@dl_modules = ();   # Modules we have loaded
+
+#XSLoader.pm may have added elements before we were required
+#@dl_librefs = ();   # things we have loaded
+#@dl_modules = ();   # Modules we have loaded
 
 # This is a fix to support DLD's unfortunate desire to relink -lc
 dl_resolve_using = dl_findfile('-lc') if $dlsrc eq dl_dld.xs;




What causes memory leaks during graceful restarts?

2002-05-21 Thread Dan Wilga

All this talk about memory leakage has got me to wondering more about 
a problem I've noticed with mod_perl ever since I started using it: 
the more times you gracefully restart, the more memory you lose.

This doesn't seem to be a result of the type of leakage that's being 
discussed in the other thread (which refers more to leakage and 
growth as the child runs normally) but is on such a large scale that 
I can only conclude that it's much more fundamental.

For example, here's what an httpd process looks like having just 
restarted it from scratch:

httpd 9063  0.0  6.6 19212 17020 ?   S11:26   0:00 
/usr/sbin/httpd -DSSL

and here's what happens after one graceful restart:

httpd 9092  0.0  9.2 25836 23644 ?   S11:27   0:00 
/usr/sbin/httpd -DSSL

Where did those 6.5 Mb go? This is without making any requests from 
the server, so my mod_perl code isn't even being run, beyond 
initialization. (I use a PerlRequire to load a bunch of libraries at 
startup.)

Are there any FAQs that address the reason for such large leakage? Or 
is this just an unavoidable problem with graceful restarts?


Dan Wilga [EMAIL PROTECTED]
Web Technology Specialist http://www.mtholyoke.edu
Mount Holyoke CollegeTel: 413-538-3027
South Hadley, MA  01075   Who left the cake out in the rain?




Re: What causes memory leaks during graceful restarts?

2002-05-21 Thread Doug MacEachern

what version of perl?  what modperl Makefile.PL options?

if you're using modperl as a dso, you'll need at least perl 5.6.1 and 
modperl-1.26 to prevent this leakage on restarts.






Re: What causes memory leaks during graceful restarts?

2002-05-21 Thread Dan Wilga

At 10:34 AM -0700 5/21/02, Doug MacEachern wrote:
what version of perl?  what modperl Makefile.PL options?

if you're using modperl as a dso, you'll need at least perl 5.6.1 and
modperl-1.26 to prevent this leakage on restarts.

I am using Perl 5.6.1, modperl 1.25, and yes it's a DSO. It's compiled with:

   USE_APACI=1 SSL_BASE=/usr/local/ssl DO_HTTPD=1

So I guess the solution is to go to 1.26 or newer; I'll try that 
later in the week.


Dan Wilga [EMAIL PROTECTED]
Web Technology Specialist http://www.mtholyoke.edu
Mount Holyoke CollegeTel: 413-538-3027
South Hadley, MA  01075Got Perl?




Re: What causes memory leaks during graceful restarts?

2002-05-21 Thread Drew Taylor

At 02:15 PM 5/21/02 -0400, Dan Wilga wrote:

I am using Perl 5.6.1, modperl 1.25, and yes it's a DSO. It's compiled with:

   USE_APACI=1 SSL_BASE=/usr/local/ssl DO_HTTPD=1

So I guess the solution is to go to 1.26 or newer; I'll try that later in 
the week.

Or to just compile mod_perl statically. Unless you need the ability to 
dynamically add in mod_perl, static is better. I'm sure the guide has all 
kinds of info about the tradeoffs of DSO vs. static.


==
Drew Taylor  |  Freelance web development using
http://www.drewtaylor.com/   |  perl/mod_perl/MySQL/postgresql/DBI
mailto:[EMAIL PROTECTED]   |  Email jobs at drewtaylor.com
--
Speakeasy.net: A DSL provider with a clue. Sign up today.
http://www.speakeasy.net/refer/29655
==




Re: What causes memory leaks during graceful restarts?

2002-05-21 Thread Doug MacEachern

On Tue, 21 May 2002, Dan Wilga wrote:
 
 I am using Perl 5.6.1, modperl 1.25, and yes it's a DSO. It's compiled with:

with 1.25, you can also set the PERL_DESTRUCT_LEVEL environment variable 
to 2, either before starting the server:

export PERL_DESTRUCT_LEVEL=2
apachectl start

or using PerlSetEnv in httpd.conf

the fix in modperl-1.26 is simply to use that value by default.