BSD::Resource and getrusage(2)
Philip M. Gollucci
pgollucci at p6m7g8.com
Fri Jul 7 08:01:37 UTC 2006
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 at 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."
More information about the freebsd-questions
mailing list