NetBSD Problem Report #55626
From www@netbsd.org Sun Aug 30 03:22:33 2020
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id DFE351A923F
for <gnats-bugs@gnats.NetBSD.org>; Sun, 30 Aug 2020 03:22:33 +0000 (UTC)
Message-Id: <20200830032232.B50C31A9242@mollari.NetBSD.org>
Date: Sun, 30 Aug 2020 03:22:32 +0000 (UTC)
From: schaecsn@gmx.net
Reply-To: schaecsn@gmx.net
To: gnats-bugs@NetBSD.org
Subject: sysutils/conky reports too low used memory
X-Send-Pr-Version: www-1.0
>Number: 55626
>Category: pkg
>Synopsis: sysutils/conky reports too low used memory
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Aug 30 03:25:00 +0000 2020
>Originator: Stefan Schaeckeler
>Release: pkgsrc-2020Q2
>Organization:
>Environment:
NetBSD XXX 9.0 NetBSD 9.0 (GENERIC) #0: Fri Feb 14 00:06:28 UTC 2020 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
>Description:
The current implementation of some memory related objects makes NetBSD look more memory efficient than it really is :D. Memory related objects such as membar or mem report too low numbers.
patches/patch-src_netbsd.c has a similar fix for info.memeasyfree:
+ /*
+ * Counter-adjust for the adjustment in update_stuff in common.c so
+ * that memeasyfree is the inactive memory. Since inactive memory
+ * partially overlaps with buffer memory, but the size of the
+ * overlap is not measured, attempting to split it into non-bufmem
+ * and bufmem parts, as common.c does, can't work. So instead we
+ * report inactive memory as memeasyfree.
+ */
+ info.memeasyfree -= info.bufmem;
I propose to do the same for info.mem. Perhaps merge below patch into patches/patch-src_netbsd.c.
>How-To-Repeat:
in .conky, display any memory related objects such as membar or mem. They report too low numbers.
>Fix:
$NetBSD$
--- src/netbsd.c.orig 2020-08-29 19:41:43.917427148 -0700
+++ src/netbsd.c 2020-08-29 19:57:28.978328623 -0700
@@ -145,6 +145,11 @@
* report inactive memory as memeasyfree.
*/
info.memeasyfree -= info.bufmem;
+ /*
+ * Counter-adjust for the adjustment in update_stuff in common.c so
+ * that mem remains used memory.
+ */
+ info.mem += info.bufmem;
return 0;
}
(Contact us)
$NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.