From owner-freebsd-hackers Tue Aug 19 10:14:48 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id KAA20386 for hackers-outgoing; Tue, 19 Aug 1997 10:14:48 -0700 (PDT) Received: from punt-2.mail.demon.net (punt-2d.mail.demon.net [194.217.242.9]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id KAA20381 for ; Tue, 19 Aug 1997 10:14:44 -0700 (PDT) Received: from longacre.demon.co.uk ([158.152.156.24]) by punt-2.mail.demon.net id aa1206762; 19 Aug 97 18:05 BST From: Michael Searle Message-ID: To: hackers@freebsd.org Subject: Fast measurement of used swap? Date: Tue, 19 Aug 1997 17:48:43 BST X-Mailer: Offlite 0.09 / Termite Internet for Acorn RISC OS Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I'm porting a system monitor from Linux. What's the fastest way of measuring the total amount of swap used (over all devices)? All the programs I've seen that do it use kvm, in fact using the same piece of code from swapinfo. This is very slow (uses several thousand syscalls) and also takes time proportional to the amount of swap (whether this is used or not), so I don't want to do this unless it's the only way. (BTW, I'm using 2.1.0 if it matters.) Thanks, Michael. -- Michael Searle - csubl@csv.warwick.ac.uk