Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Dec 2023 15:26:28 -0500
From:      Garrett Wollman <wollman@bimajority.org>
To:        "Patrick M. Hausen" <hausen@punkt.de>
Cc:        Yuri <yuri@aetern.org>, FreeBSD-STABLE Mailing List <freebsd-stable@freebsd.org>
Subject:   Re: Odd values for various memory metrics via SNMP
Message-ID:  <25996.34932.339497.605798@hergotha.csail.mit.edu>
In-Reply-To: <A09B8144-EC0A-42DD-AAD6-D3C1E7FDFEB9@punkt.de>
References:  <1EDAF2AC-3A2B-43BE-B66B-E095F5A80C2C@punkt.de> <de2988a0-00d6-4b4b-8150-bfa235649d64@aetern.org> <84B7C7D7-BC06-4944-A7E0-5AFC47B6BC0E@punkt.de> <8f4cf72e-8320-4bfd-a4d9-3db34db4580d@aetern.org> <A09B8144-EC0A-42DD-AAD6-D3C1E7FDFEB9@punkt.de>

next in thread | previous in thread | raw e-mail | index | archive | help
<<On Tue, 19 Dec 2023 20:16:38 +0100, "Patrick M. Hausen" <hausen@punkt.de> said:

> Now only "virtual memory" is left - according to the book that should be
> the sum of physical memory and swap space - and for my single Linux
> host it is.

> For the FreeBSD systems this is the one left that still looks nonsensical.

> OPNsense (8G RAM, 8G swap): 4.91 of 4.99G used.
> TrueNAS (64G RAM, 32G swap): 627 of 628G used.
> TrueNAS 2 (32G RAM, 32G swap): 512 of 516G used.

This is computed by the function vmtotal() in sys/vm/vm_meter.c.  It
walks all VM objects in the system, skipping those that are
unreferenced, and adds up all of their sizes.  There is one VM object
for every open file and every running executable, shared library, and
mmap()ed region, plus one for every copy-on-write mapping for each
process that has modified it, which includes the data segment of every
executable and shared library.  This has no connection to either
physical memory or swap space.

The "shared" statistics count only and exactly the underlying
(read-only) mapping of objects that are mapped with copy-on-write
semantics.

-GAWollman




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?25996.34932.339497.605798>