Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 06 Jul 2003 09:29:41 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Vivek Khera <khera@kcilink.com>
Cc:        hackers@freebsd.org
Subject:   Re: process sizes
Message-ID:  <3F084E75.1CC3058@mindspring.com>
References:  <16133.55711.263062.288990@yertle.int.kciLink.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Vivek Khera wrote:
> Now, currently, the BSD code from SizeLimit reads like this:
> 
> sub bsd_size_check {
>     return (&BSD::Resource::getrusage())[2,3];
> }
> 
> This routine is intended to return the current process size and shared
> memory size.  However, the getrusage() above is not really doing what
> is intended.  The shared pages value returned is way wrong (only text
> pages are given by getrusage) and the current process size is not the
> MAX RSS, which is returned above.
> 
> I'm at a loss as to what to use to measure the current process size
> and also to measure the amount of virtual memory in use by that
> process that is in shared pages.
> If anyone has good code to get this information on FreeBSD (and other
> BSD's in general) please let me know.  If additional libraries are
> needed, that's ok.  If we have to poke around /proc, that's ok to.
> 
> I'd appreciate direct replies since I'm away at OSCON next week and
> don't want to miss anything.  Thanks.

You are aware that POSIX only requires that the struct rusage have
system and user timeval members, right?

http://www.opengroup.org/onlinepubs/007904975/basedefs/sys/resource.h.html

-- Terry



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3F084E75.1CC3058>