Some time in the summer this year I started noticing that memory usage would become very high after a while. Specifically, XOrg would start hogging inane amounts of memory.
I use an NVidia GTX2070S card on my desktop computer (which uses the x86_64
architecture), so I just lazily think to myself "well NVidia is at it again" and
think not of it again.
Recently, after becoming irate with XOrg crashing in the middle of games, or losing my open programs (and having to open 10 terminals again), I decided to look into the source.
The estimated rate of leak was about 1 Megabyte per 10 seconds with nothing launched but my basic desktop utilities, which include:
polybar
(which I often kill for fullscreen gameplay, so it can't be it)feh
in a bash script that runs it every 20 minutes for a new desktop backgroundconky
which gives me fancy stats I can't see most of the ti- wait a second
So immediately I restart my X session, kill conky
and it stops leaking. An
hour passes and only a single megabyte gets allocated.
The Conky Repository
I use vanilla Conky on Arch, aka. extra/conky
. It is developed over at
github.com/brndnmtthws/conky
.
Searching for is:issue memory Xorg
on the repository leads to issue
#1442, which details high
CPU and memory usage following a regression after introducing the use of new
colour data types for X11.
As it turns out, the pixel color data was being allocated, but not cached, and kept being allocated again and again.
Well, darn.
The faulty commit,
5e98c49
,
was introduced on February 24th 2023, and released into v1.18.1
the same day.
The fix, commit c08a782
, or 8f0a21b
in the repository, fixes the issue, and was shipped in 1.18.2
.
So... it was fixed in March? Why's it still broken?
The Conky ArchLinux Package
As of writing this, ArchLinux ships version 1.18.1-2
of Conky, which I know is
faulty.
The package is apparently marked as deprecated, and has been since 2023-03-04,
the day 1.18.2
was released and the leak fixed. Yet, Conky on ArchLinux was
updated on 2023-09-03.. What's up?
Packaging versions do not follow the same naming standards as software release.
Conky 1.18.1 was first released for ArchLinux on
February 24th 2023
as 1.18.1-1
by Levente Polyak, maintainer of the package.
On September 19th
2023
they released 1.18.1-2
... Which essentially just locked the build to a tag,
specified some SPDX license identifiers, and enabled Wayland.
And that's it. No pulling the new version (by then, Conky v1.19.4
had been
released upstream for a month).
So...?
There's not much to take away from this. Packaging is done by people. People are busy. Sometimes packages are stuck. We are stuck with this Conky leaking huge amounts of RAM for now... I might update this if I find more things, or when it gets solved.
Hopefully if you had the same problem, and you were as lazy as I was to diagnose it, now you know why.