Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 07 Jul 2006 01:01:57 -0700
From:      "Philip M. Gollucci" <pgollucci@p6m7g8.com>
To:        questions@FreeBSD.org
Cc:        dev@perl.apache.org
Subject:   BSD::Resource and getrusage(2)
Message-ID:  <44AE14F5.3020608@p6m7g8.com>

next in thread | raw e-mail | index | archive | help
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."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44AE14F5.3020608>