Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Jan 2003 01:14:19 -0800
From:      David Schultz <dschultz@uclink.Berkeley.EDU>
To:        Matthew Dillon <dillon@apollo.backplane.com>
Cc:        James Gritton <gritton@iserver.com>, freebsd-hackers@FreeBSD.ORG
Subject:   Re: What's the memory footprint of a set of processes?
Message-ID:  <20030130091419.GA7776@HAL9000.homeunix.com>
In-Reply-To: <200301300719.h0U7JOfI086054@apollo.backplane.com>
References:  <Pine.BSF.4.21.0301291145030.25856-100000@InterJet.elischer.org> <x7k7gnog4m.fsf@guppy.dmz.orem.verio.net> <20030130064448.GA7258@HAL9000.homeunix.com> <200301300719.h0U7JOfI086054@apollo.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Thus spake Matthew Dillon <dillon@apollo.backplane.com>:
>     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 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?20030130091419.GA7776>