From owner-freebsd-hackers Wed Jan 29 11:40:41 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4DF7B37B401 for ; Wed, 29 Jan 2003 11:40:40 -0800 (PST) Received: from gatekeeper.oremut01.us.wh.verio.net (gatekeeper.oremut01.us.wh.verio.net [198.65.168.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9CF0F43E4A for ; Wed, 29 Jan 2003 11:40:39 -0800 (PST) (envelope-from gritton@iserver.com) Received: from guppy.dmz.orem.verio.net (guppy.dmz.orem.verio.net [10.1.1.55]) by gatekeeper.oremut01.us.wh.verio.net (Postfix) with ESMTP id 28AC53BF19A for ; Wed, 29 Jan 2003 12:40:34 -0700 (MST) Received: from guppy.dmz.orem.verio.net by guppy.dmz.orem.verio.net; Wed, 29 Jan 2003 12:40:33 -0700 (MST) Received: (from gritton@localhost) by guppy.dmz.orem.verio.net (8.12.3/8.12.3/Submit) id h0TJeXm1022866; Wed, 29 Jan 2003 12:40:33 -0700 (MST) Date: Wed, 29 Jan 2003 12:40:33 -0700 (MST) Message-Id: <200301291940.h0TJeXm1022866@guppy.dmz.orem.verio.net> X-Authentication-Warning: guppy.dmz.orem.verio.net: gritton set sender to gritton@iserver.com using -f From: James Gritton To: freebsd-hackers@FreeBSD.ORG Subject: What's the memory footprint of a set of processes? Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG How do I find how much memory (real and/or virtual) is being used by a set of processes, taking shared pages into account? I see per-process numbers I can use (vmspace_resident_count and vmspace_swap_count), and overall usage numbers exist, but I can't find a better way of measuring multiple processes than adding their individual totals together. This can lead to wild inaccuracies if a few processes share a lot of pages (Java comes to mind, as do database servers). Is there some kind of reference count I can access per page, or some not-too-expensive way to see what processes are using a page? I see some things in the VM code that look like recerence counts (such as act_count in struct vm_page), but they don't seem to really be such, or at least they don't count what I'm expecting them to. This is on 4.7. I haven't really looked at 5, so I don't know how different it is. - James Gritton gritton@iserver.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message