perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philip M. Gollucci" <pgollu...@p6m7g8.com>
Subject Re: [PATCH] Apache2::SizeLimit on Linux
Date Sun, 07 Aug 2005 23:19:49 GMT
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


Mime
View raw message