NetBSD Problem Report #56628
From adrian@mx.aik.onl Fri Jan 14 19:22:47 2022
Return-Path: <adrian@mx.aik.onl>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_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 98C4E1A9239
for <gnats-bugs@gnats.NetBSD.org>; Fri, 14 Jan 2022 19:22:47 +0000 (UTC)
Message-Id: <20220114192242.9F74727225@www3.kiess.onl>
Date: Fri, 14 Jan 2022 20:22:42 +0100 (CET)
From: adrian@mx.aik.onl
Reply-To: adrian@kiess.onl
To: gnats-bugs@NetBSD.org
Subject: py39-Glances-3.2.3.1 from pkgsrc-2021Q3 on amd64 has memory leak and displays wrong swapspace statistics
X-Send-Pr-Version: 3.95
>Number: 56628
>Category: pkg
>Synopsis: py39-Glances-3.2.3.1 from pkgsrc-2021Q3 on amd64 has memory leak and displays wrong swapspace statistics
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: fox
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Jan 14 19:25:00 +0000 2022
>Closed-Date: Wed Apr 22 11:49:37 +0000 2026
>Last-Modified: Wed Apr 22 11:49:37 +0000 2026
>Originator: Adrian Immanuel Kiess
>Release: NetBSD 9.2
>Organization:
KIESS.ONL
>Environment:
System: NetBSD www3.kiess.onl 9.2 NetBSD 9.2 (GENERIC) #0: Wed May 12 13:15:55 UTC 2021 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
py39-Glances-3.2.3.1 from the pkgsrc-2021Q3 amd64 binaries has a memory leak and displays wrong swapspace statistics.
I would like to use Glances to monitor my NetBSD VPS, but the memory leak makes it impossible to use it for this usecase.
Running Glances on NetBSD for about a day, the Glances process can get up to over 4 Gigabyte large in memory.
In addition to that, the SWAP statistics are wrong and display negative values.
I also use Glances on FreeBSD and Debian, where both Glances works fine.
Thank you very much for your kind attention.
Sincerely,
Adrian Kiess
>How-To-Repeat:
# pkgin install py39-Glances, $ glances-3.9 and watch the memory usage of the glances process, it will continue to grow to very large values in RAM over time
>Fix:
Sadly, I don't know how to fix this.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: pkg-manager->fox
Responsible-Changed-By: wiz@NetBSD.org
Responsible-Changed-When: Sat, 15 Jan 2022 09:04:04 +0000
Responsible-Changed-Why:
Over to maintainer
From: Santhosh Raju <santhosh.raju@gmail.com>
To: gnats-bugs@netbsd.org
Cc: Thomas Klausner <wiz@netbsd.org>
Subject: Re: pkg/56628
Date: Thu, 9 Apr 2026 20:31:41 +0200
The root cause of this was identified back to the sysutils/py-psutil
package and how it computes the swap. The fix was to remove psutil's
dependency on procfs to derive the CPU / memory statistics and get
them via sysctl(3) calls in psutil.
- https://pkgsrc.se/files.php?messageId=20260406165312.61E3BFA2B@cvs.NetBSD.org
- https://pkgsrc.se/files.php?messageId=20260407054912.E3D02FA2B@cvs.NetBSD.org
- https://pkgsrc.se/files.php?messageId=20260407060123.D1E5FFA2B@cvs.NetBSD.org
sysutils/py-Glances uses this library to derive the various CPU /
Memory metrics that it displays in the UI.
As of py313-Glances-4.5.3 and py313-psutil-7.2.2nb2 (which are both
available in pkgsrc-current), this issue should be fixed.
- No longer glances process grows to a large size due to memory leak
(especially when putting it up for extended periods).
- The swap statistics should be shown correctly.
Upstream fixes have been submitted to psutil and this has been merged,
so future updates of sysutils/py-psutils should no longer (hopefully)
break glances.
- https://github.com/giampaolo/psutil/pull/2805
P.S: I know this is a very delayed reply to a report from 2022, but
better to address it late than never.
P.S: Will wait a couple of months before closing the ticket in case
the original reporter wants to reply back.
Regards
Santhosh
State-Changed-From-To: open->feedback
State-Changed-By: fox@NetBSD.org
State-Changed-When: Thu, 09 Apr 2026 18:36:56 +0000
State-Changed-Why:
The issue has been fixed and a detailed reply was appended to the ticket explaining the root cause and the fixes done. Now waiting for reporter feedback.
From: =?UTF-8?Q?Adrian_Kie=C3=9F?= <adrian@kiess.onl>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: pkg/56628
Date: Wed, 22 Apr 2026 08:10:22 +0200
Dear Maintainer,
I tested with version glances-3.14 on NetBSD 10.1.
The memory usage and swap space informations given through the program
look good now.
Thank you a lot for your kind reply and help.
Sincerely,
Adrian Kiess
State-Changed-From-To: feedback->closed
State-Changed-By: bsiegert@NetBSD.org
State-Changed-When: Wed, 22 Apr 2026 11:49:37 +0000
State-Changed-Why:
confirmed fixed
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.