Thus spake Matthew Dillon <[EMAIL PROTECTED]>:
>     Generally speaking I don't think you have to go into this level of
>     detail to figure out approximate real memory use.  Just look at the
>     output of the /proc/PID/map and pull out the 'default' or 'swap'
>     lines.  Ignore the 'vnode' lines.
...
>     Now you have two metrics.  You can calculate the size based on the 
>     range (the first two arguments).  (addressB - addressA), and you can get
>     the total number of resident pages from the third argument.  What you
>     can't do easily is figure out the total allocation because that is
>     actually going to be resident pages + swapped pages.  swapped pages is
>     not included in the proc output.

I think the original poster wanted to know the real memory use of
a set of processes, taking sharing into account.  I don't see how
your approach could do that.  Even if you knew the structure of
the shadow chain, you would have to know specifically which pages
had been COWed, no?

I thought counting vm_page structures would be the way to go...
I really want to find the time to learn all this stuff better.
I still don't know the difference between COW and NEEDS_COPY,
or why the pageout daemon seems to be biased against shared
pages, or a lot of things about pv_entry structures.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to