From owner-freebsd-questions@FreeBSD.ORG Fri Jul 7 12:10:46 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 3989316A4DD for ; Fri, 7 Jul 2006 12:10:46 +0000 (UTC) (envelope-from autarch@urth.org) Received: from urth.org (urth.org [65.103.28.217]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3106043D4C for ; Fri, 7 Jul 2006 12:10:45 +0000 (GMT) (envelope-from autarch@urth.org) Received: from autarch (helo=localhost) by urth.org with local-esmtp (Exim 4.60) (envelope-from ) id 1FypAP-00040D-Pb; Fri, 07 Jul 2006 07:10:41 -0500 Date: Fri, 7 Jul 2006 07:10:41 -0500 (CDT) From: Dave Rolsky To: "Philip M. Gollucci" In-Reply-To: <44AE14F5.3020608@p6m7g8.com> Message-ID: References: <44AE14F5.3020608@p6m7g8.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: questions@FreeBSD.org, dev@perl.apache.org Subject: Re: 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 12:10:46 -0000 On Fri, 7 Jul 2006, Philip M. Gollucci wrote: > 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 Doesn't that imply that it's in kb per stat clock ticks? >> 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. If it's reported share memory as greater than total memory, then I think the docs for BSD::Resource are correct. We need to divide that second number (ixrss) by the value of the stat clock tick. Any idea how that can be determined? -dave /*=================================================== VegGuide.Org www.BookIRead.com Your guide to all that's veg. My book blog ===================================================*/