perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philip M. Gollucci" <pgollu...@p6m7g8.com>
Subject BSD::Resource and getrusage(2)
Date Fri, 07 Jul 2006 08:01:57 GMT
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."

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message