Re: Odd values for various memory metrics via SNMP

From: Patrick M. Hausen <hausen_at_punkt.de>
Date: Sat, 06 Jan 2024 12:02:26 UTC
Hi all,

> Am 27.12.2023 um 21:26 schrieb Garrett Wollman <wollman@bimajority.org>:
> 
> <<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.

Why does FreeBSD calculate the values this way while MWL's book clearly
states differently? Who's wrong here?

Browsing the host resources MIB I can only find the syntactical definition of
the hrStorage subtree but nowhere was I able to find a definitive documentation
on the semantics what certain entries like "virtual memory" are supposed to mean?

I'll go ask MWL where he got what he wrote in his book, but I'm still confused.
There must be some standard for meaningful values, right?

Kind regards,
Patrick
-- 
punkt.de GmbH
Patrick M. Hausen
.infrastructure

Sophienstr. 187
76185 Karlsruhe

Tel. +49 721 9109500

https://infrastructure.punkt.de
info@punkt.de

AG Mannheim 108285
Geschäftsführer: Daniel Lienert, Fabian Stein