Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 May 2002 17:12:44 -0700
From:      Alfred Perlstein <bright@mu.org>
To:        Ed Hall <edhall@weirdnoise.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Memory and Reality
Message-ID:  <20020512001244.GN90188@elvis.mu.org>
In-Reply-To: <200205112015.g4BKFt390577@screech.weirdnoise.com>
References:  <200205112015.g4BKFt390577@screech.weirdnoise.com>

next in thread | previous in thread | raw e-mail | index | archive | help
* Ed Hall <edhall@weirdnoise.com> [020511 13:13] wrote:
> At Yahoo! we use a lot of shared memory, both in the form of .so's and
> for IPC.  It would be very useful to be able to accurately measure the
> amount of shared and private memory associated with a process, the
> number of references to a given shared memory object, resident vs. non-
> resident pages, and so forth.
> 
> Determining just what is shared and by how many is the hardest part.
> When I asked Peter Wemm about sussing out this sort of info from
> proc/*/map, he made some comments about the difficulty of knowing what
> actually was shared and what wasn't, how the refcounts aren't exactly
> what one might think they are, and so forth.  The same sort of ambiguity
> seemed to exist regarding just what is resident (with the term defined
> as "in RAM with no need to retrieve from secondary storage") and what
> isn't.
> 
> Are things really this bad?  Is there a tool out there that can make
> sense of FreeBSD's memory state with more accuracy and detail than
> "ps" or "top"?  This is a serious issue.  Whether this is exclusively
> a FreeBSD problem or not, developers tend to see it that way.

You'd have to write it yourself, I'm not sure exactly what you sort
of information you're trying to pull, however the easiest way to
do this would be to look at
p->p_vmspace->vm_map->{list of vm_map_entries}
you can then walk this list looking at the object referenced by the
map, I think most of the information "shared"/"nonshared" etc
can be pulled from the vm_map_entry.

-Alfred

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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