public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Folke Gleumes <f.gleumes@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [RFC common 2/4] add more detailed statistics to memory report
Date: Mon, 11 Dec 2023 15:47:19 +0100	[thread overview]
Message-ID: <20231211144721.212071-3-f.gleumes@proxmox.com> (raw)
In-Reply-To: <20231211144721.212071-1-f.gleumes@proxmox.com>

Signed-off-by: Folke Gleumes <f.gleumes@proxmox.com>
---
 src/PVE/ProcFSTools.pm | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/PVE/ProcFSTools.pm b/src/PVE/ProcFSTools.pm
index 3826fcc..5f5d768 100644
--- a/src/PVE/ProcFSTools.pm
+++ b/src/PVE/ProcFSTools.pm
@@ -279,7 +279,10 @@ sub read_meminfo {
     my $res = {
 	memtotal => 0,
 	memfree => 0,
+	memavailable => 0,
 	memused => 0,
+	membuffers => 0,
+	memcached => 0,
 	memshared => 0,
 	swaptotal => 0,
 	swapfree => 0,
@@ -299,7 +302,13 @@ sub read_meminfo {
     close($fh);
 
     $res->{memtotal} = $d->{memtotal};
-    $res->{memfree} =  $d->{memfree} + $d->{buffers} + $d->{cached};
+    $res->{memfree} = $d->{memfree};
+    $res->{membuffers} = $d->{buffers};
+    $res->{memcached} = $d->{cached};
+    $res->{memshared} = $d->{memshared};
+
+    # memfree is unused memory, memused is everything that is in use
+    # be it by caches, buffers or applications
     $res->{memused} = $res->{memtotal} - $res->{memfree};
 
     $res->{swaptotal} = $d->{swaptotal};
-- 
2.39.2





  parent reply	other threads:[~2023-12-11 14:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-11 14:47 [pve-devel] [RFC cluster/common/widget-toolkit/manager 0/4] split node memory graph into usage types Folke Gleumes
2023-12-11 14:47 ` [pve-devel] [RFC cluster 1/4] rrd: add free, buffer/cache and arc size to memory statistics Folke Gleumes
2023-12-12  7:49   ` DERUMIER, Alexandre
2023-12-11 14:47 ` Folke Gleumes [this message]
2023-12-11 14:47 ` [pve-devel] [RFC widget-toolkit 3/4] add option to display rrd graph as stacking Folke Gleumes
2023-12-11 14:47 ` [pve-devel] [RFC manager 4/4] split ram usage into usage types Folke Gleumes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231211144721.212071-3-f.gleumes@proxmox.com \
    --to=f.gleumes@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal