* Ed Hall <[EMAIL PROTECTED]> [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 [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message