From owner-freebsd-questions@FreeBSD.ORG Fri Jul 7 17:11:11 2006 Return-Path: X-Original-To: questions@FreeBSD.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 97D0F16A4DD for ; Fri, 7 Jul 2006 17:11:11 +0000 (UTC) (envelope-from pgollucci@p6m7g8.com) Received: from piccollo.p6m7g8.net (c66-236-219-70.ip.panth.com [66.236.219.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id 536C643D46 for ; Fri, 7 Jul 2006 17:11:10 +0000 (GMT) (envelope-from pgollucci@p6m7g8.com) Received: from [172.28.57.204] (office4.tmcs.net [209.104.55.5]) (authenticated bits=0) by piccollo.p6m7g8.net (8.13.6/8.13.6) with ESMTP id k67HB9Ct041461 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO); Fri, 7 Jul 2006 13:11:10 -0400 (EDT) (envelope-from pgollucci@p6m7g8.com) Message-ID: <44AE95A3.2050507@p6m7g8.com> Date: Fri, 07 Jul 2006 10:10:59 -0700 From: "Philip M. Gollucci" Organization: P6M7G8 Inc. User-Agent: Thunderbird 1.5 (X11/20060313) MIME-Version: 1.0 To: Dave Rolsky References: <44AE14F5.3020608@p6m7g8.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: questions@FreeBSD.org, dev@perl.apache.org Subject: Re: BSD::Resource and getrusage(2) [PATCH] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jul 2006 17:11:11 -0000 > Doesn't that imply that it's in kb per stat clock ticks? I think you read it backwards, but I agree with the outcome. svn diff Index: lib/Apache/SizeLimit.pm =================================================================== --- lib/Apache/SizeLimit.pm (revision 419830) +++ lib/Apache/SizeLimit.pm (working copy) @@ -247,8 +247,15 @@ return ( $size, 0 ); } +## rss is in KB +## ixrss is in BYTES +## this is true on at least FreeBSD, OpenBSD, NetBSD, and Darwin sub _bsd_size_check { - return ( BSD::Resource::getrusage() )[ 2, 3 ]; + my @results = BSD::Resource::getrusage(); + my $max_rss = $results[2]; + my $max_ixrss = int ( $results[3] / 1024 ); + + return ( $max_rss, $max_ixrss ); } -- ------------------------------------------------------------------------ Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708 Consultant / http://p6m7g8.net/Resume/resume.shtml Senior Software Engineer - TicketMaster - http://ticketmaster.com 1024D/A79997FA F357 0FDD 2301 6296 690F 6A47 D55A 7172 A799 97F "It takes a minute to have a crush on someone, an hour to like someone, and a day to love someone, but it takes a lifetime to forget someone..."