🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: muc.lists.netbsd.tech.userlevel
Article #13

Re: systat vm free units

#13
From: Taylor R Campbell
Date: Fri, 16 Oct 2026 18:36
53 lines
4004 bytes
> Date: Fri, 16 Oct 2026 15:25:14 +0000
> From: Emmanuel Dreyfus <manu@netbsd.org>
> 
> Hello
> 
> systat(1) called with the vm argument shows some VM statistics, 
> including free memory. Here is the output:
> 
> Anon      2681436  33%   zero         
> Exec       202860   2%   wired   88688
> File      1402936  17%   inact  247712
> Meta       146893    %   bufs    13519
>  (kB)        real   swaponly      free
> Active    3950772              3071716 

Isn't this saying all the numbers (other than those marked with %) are
in kilobytes?

> The man page says:
>   Below this are statistics on memory utilization.  The first
>   row of the table reports memory usage only among active pro-
>   cesses, that is processes that have run in the previous
>   twenty seconds.  The second row reports on memory usage of
>   all processes.  The first column reports on the number of
>   physical pages claimed by processes.  The second column
>   reports the number of pages of memory and swap.  The third
>   column gives the number of pages of free memory and swap.
> 
> That does not fit the display very well, it seems systat was
> updated and the documentation was left behind. I assume 
> 3071716 is the unued memory, but it cannot be in pages:
> hw.physmem64 = 8503410688
> hw.pagesize = 4096
> 
> 3071716 pages of 4096 bytes would not fit in 8503410688 bytes.
> Most likely the numbers are in kB. 
> 
> Did I miss something or this man page needs an update?

The npage ma text and the current code came from a patch by Greg Woods
in 2007 (applied in 2018), submitted in PR bin/36542: better "systat
vm" output <https://gnats.NetBSD.org/36542>.

It looks to me like the man page should say `kilobytes', not
`pages'.  If I'm reading the right part of the code (after 30sec of
skimming), it appears to be converting internal numbers of pages to
display numbers of kilobytes:

https://nxr.NetBSD.org/xref/src/usr.bin/systat/vmstat.c?r=1.93#499

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Technical Details
Message-ID: <20261016183602.3174984E83@mail.netbsd.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail
References: <atJB2l1t5Bs3pVfQ@homeworld.netbsd.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail
From: Taylor R Campbell <riastradh@NetBSD.org>
Newsgroups: muc.lists.netbsd.tech.userlevel
Subject: Re: systat vm free units
Date: Fri, 16 Oct 2026 18:36:01 +0000
Organization: Newsgate at muc.de e.V.
Sender: tech-userlevel-owner@NetBSD.org
Approved: news-admin@muc.de
Distribution: world
Message-ID: <20261016183602.3174984E83@mail.netbsd.org>
References: <atJB2l1t5Bs3pVfQ@homeworld.netbsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2";
	logging-data="45323"; mail-complaints-to="news-admin@muc.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netbsd.org;
	s=20240131; t=1792175766;
	bh=Ly7/WNs5WUbFSiG9FaKJUoAe7Ht23ARUVTtrK7MJpl8=;
	h=To:CC:In-reply-to:Subject:Date:From:List-Id:List-Unsubscribe;
	b=u2hDdMPyr8K+fMK+wnwUM21InOan9gVbWq3p9GPYugvLO88Wj9WNnlb3anvqEAhzq
	 KmWuKPK4+xOBc+lhkAc1DvPHgOiJ0OQ+vgAYLGHq007/9YelPyrsBIZbEcAzTQrRzy
	 igNaPpJQnopvbgMhT2mpqRDMaY6VVuFtzycFfFhc=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netbsd.org;
	s=20240131; t=1792175762;
	bh=Ly7/WNs5WUbFSiG9FaKJUoAe7Ht23ARUVTtrK7MJpl8=;
	h=To:CC:In-reply-to:Subject:Date:From;
	b=KpOYdcsKu57+AGWoXcOJcoLS74m7uMe+Cd7Q/NqLvq+Ix+zH9BYpfkc9CeXgiH5O3
	 kSITeJDy48pgSPtk2wdUgxPVgJZGIHAZCtR3bIpz1yUZjhkoe+hom8gusGkVKl+Sm9
	 eHTLsJDfCb3MRFy8xINg05aWaWQ+dn8TZTqDfTLg=
In-reply-to: <atJB2l1t5Bs3pVfQ@homeworld.netbsd.org> (manu@netbsd.org)
Precedence: bulk
X-Newsgate-Id: f02c70b8849f+
X-No-Archive: Yes