Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 76910 invoked from network); 7 Aug 2005 23:20:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Aug 2005 23:20:10 -0000 Received: (qmail 37314 invoked by uid 500); 7 Aug 2005 23:20:04 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 37293 invoked by uid 500); 7 Aug 2005 23:20:04 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 37278 invoked by uid 99); 7 Aug 2005 23:20:04 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Aug 2005 16:20:04 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [66.236.219.70] (HELO piccollo.p6m7g8.net) (66.236.219.70) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Aug 2005 16:19:53 -0700 Received: from [192.168.1.129] (pcp09959070pcs.hyatsv01.md.comcast.net [69.143.249.144]) (authenticated bits=0) by piccollo.p6m7g8.net (8.13.4/8.13.4) with ESMTP id j77NJv4r046764 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO); Sun, 7 Aug 2005 19:20:00 -0400 (EDT) (envelope-from pgollucci@p6m7g8.com) Message-ID: <42F69715.70501@p6m7g8.com> Date: Sun, 07 Aug 2005 19:19:49 -0400 From: "Philip M. Gollucci" User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Torsten Foertsch CC: modperl@perl.apache.org Subject: Re: [PATCH] Apache2::SizeLimit on Linux References: <200508072037.41464.torsten.foertsch@gmx.net> In-Reply-To: <200508072037.41464.torsten.foertsch@gmx.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Torsten Foertsch wrote: > --- mod_perl-2.0.1/lib/Apache2/SizeLimit.pm~ 2005-04-26 20:58:44.000000000 +0200 > +++ mod_perl-2.0.1/lib/Apache2/SizeLimit.pm 2005-08-07 17:56:00.691361040 +0200 > @@ -56,7 +56,11 @@ > > } elsif (LINUX) { > > - $HOW_BIG_IS_IT = \&linux_size_check; > + if ( eval { require Linux::Smaps } and Linux::Smaps->new($$) ) { > + $HOW_BIG_IS_IT = \&linux_smaps_size_check; > + } else { > + $HOW_BIG_IS_IT = \&linux_size_check; > + } > > } elsif (BSD_LIKE) { > > @@ -85,6 +89,11 @@ > } > } > > +sub linux_smaps_size_check { > + my $s=Linux::Smaps->new($$)->all; > + return ($s->size, $s->shared_clean+$s->shared_dirty); > +} > + > # return process size (in KB) > sub linux_size_check { > my($size, $resident, $share) = (0, 0, 0); It looks sane to me, but I don't have a Linux comp to test on yet. I might in a week or so; but I wouldn't be able to commit it until then. -- END ------------------------------------------------------------ What doesn't kill us can only make us stronger. Nothing is impossible. Philip M. Gollucci (pgollucci@p6m7g8.com) 301.254.5198 Consultant / http://p6m7g8.net/Resume/ Senior Developer / Liquidity Services, Inc. http://www.liquidityservicesinc.com http://www.liquidation.com http://www.uksurplus.com http://www.govliquidation.com http://www.gowholesale.com