From owner-freebsd-questions@FreeBSD.ORG Fri Jul 7 08:01:37 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 67E0016A4DE for ; Fri, 7 Jul 2006 08:01:37 +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 0C32D43D72 for ; Fri, 7 Jul 2006 08:01:34 +0000 (GMT) (envelope-from pgollucci@p6m7g8.com) Received: from [192.168.0.210] (c-24-130-79-25.hsd1.ca.comcast.net [24.130.79.25]) (authenticated bits=0) by piccollo.p6m7g8.net (8.13.6/8.13.6) with ESMTP id k6781SSc034823 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO); Fri, 7 Jul 2006 04:01:29 -0400 (EDT) (envelope-from pgollucci@p6m7g8.com) Message-ID: <44AE14F5.3020608@p6m7g8.com> Date: Fri, 07 Jul 2006 01:01:57 -0700 From: "Philip M. Gollucci" Organization: P6M7G8 Inc. User-Agent: Thunderbird 1.5.0.4 (X11/20060627) MIME-Version: 1.0 To: questions@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: dev@perl.apache.org Subject: BSD::Resource and getrusage(2) 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 08:01:37 -0000 Hi, I'm trying do determine the units for one of the fields returned by getrusage(2) man page on 6.0-RELEASE-p5 says this: 2 maxrss maximum shared memory or current resident set 3 ixrss integral shared memory ru_ixrss an ``integral'' value indicating the amount of memory used by the text segment that was also shared among other pro- cesses. This value is expressed in units of kilobytes * ticks-of-execution. Ticks are statistics clock ticks. The statistics clock has a frequency of sysconf(_SC_CLK_TCK) which to me implies thats in kilobytes, but to the contrary, we have the following CPAN rt: https://rt.cpan.org/Ticket/Display.html?id=18230 I'll paste the import part of this here so you don't have to follow the link >ApacheSizeLimit on bsd systems uses BSD::Resource to get the memory and >shared-pages size. > sub bsd_size_check { > return (&BSD::Resource::getrusage())[2,3]; > } I also have a local test based on the recent Apache::SizeLimit work from Dave Rolsky where maxrss > ixrss (Apache-Test output snipped) # '14124' maxrss # > # '52080' ixrss I tried looking in src/sys/kern/kern_resource.c but I didn't find anything that told me the units. My inkling is the documentation is WRONG. ------------------------------------------------------------------------ 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 "In all that I've done wrong I know I must have done something right to deserve a hug every morning and butterfly kisses at night."