How to fix RAM memory leak bug on a computer with AMD Ryzen 7 2700X and AMD RX 5700XT?

Hello,

I own AMD Ryzen 7 2700X and Gigabyte AMD RTX 5700XT. My old GPU was NVIDIA GeForce GTX 1660.

Conky shows that, when I open an app or a browser, the RAM memory rectange gets full one second with “-580MB” and returns to the normal more one second, and gets full again with the same negative memory, and the same… At sometimes, it takes more or less than 10 seconds to load an app or a browser.

I’ve read the following topics:

My computers details:

System:    Kernel: 5.8.11-arch1-1 x86_64 bits: 64 compiler: N/A Desktop: i3 4.18.2-10-g07d82753 Distro: EndeavourOS 
Machine:   Type: Desktop Mobo: BIOSTAR model: X370GT7 serial: <filter> UEFI [Legacy]: American Megatrends v: 5.13 
           date: 08/07/2018 
CPU:       Info: 8-Core model: AMD Ryzen 7 2700X bits: 64 type: MT MCP arch: Zen+ rev: 2 L2 cache: 4096 KiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 118239 
           Speed: 2437 MHz min/max: 2200/3700 MHz Core speeds (MHz): 1: 2705 2: 2416 3: 2153 4: 2187 5: 1885 6: 1908 7: 1885 
           8: 1884 9: 1714 10: 1726 11: 1713 12: 1727 13: 1818 14: 1725 15: 1884 16: 1887 
Graphics:  Device-1: Advanced Micro Devices [AMD/ATI] Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] vendor: Gigabyte 
           driver: amdgpu v: kernel bus ID: 0b:00.0 
           Display: x11 server: X.Org 1.20.9 driver: amdgpu unloaded: fbdev,modesetting resolution: 2560x1080~60Hz 
           OpenGL: renderer: AMD Radeon RX 5700 XT (NAVI10 DRM 3.38.0 5.8.11-arch1-1 LLVM 10.0.1) v: 4.6 Mesa 20.1.8 
           direct render: Yes 
Audio:     Device-1: Advanced Micro Devices [AMD/ATI] Navi 10 HDMI Audio driver: snd_hda_intel v: kernel bus ID: 0b:00.1 
           Device-2: Advanced Micro Devices [AMD] Family 17h HD Audio vendor: Biostar Microtech Intl Corp 
           driver: snd_hda_intel v: kernel bus ID: 0d:00.3 
           Sound Server: ALSA v: k5.8.11-arch1-1 
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Biostar Microtech Intl Corp driver: r8169 
           v: kernel port: f000 bus ID: 05:00.0 
           IF: enp5s0 state: up speed: 1000 Mbps duplex: full mac: <filter> 
           IP v4: <filter> type: dynamic noprefixroute scope: global 
           IP v6: <filter> type: dynamic noprefixroute scope: global 
           IP v6: <filter> type: noprefixroute scope: link 
           WAN IP: <filter> 
Drives:    Local Storage: total: 2.55 TiB used: 231.35 GiB (8.9%) 
           ID-1: /dev/sda vendor: Samsung model: ST2000DM008-2FR102 size: 1.82 TiB 
           ID-2: /dev/sdb vendor: A-Data model: SU630 size: 447.13 GiB 
           ID-3: /dev/sdc vendor: Samsung model: HD082GJ size: 74.53 GiB 
           ID-4: /dev/sdd vendor: Kingston model: SA400S37240G size: 223.57 GiB 
Partition: ID-1: / size: 424.44 GiB used: 22.06 GiB (5.2%) fs: ext4 dev: /dev/sdb2 
           ID-2: /home size: 1.73 TiB used: 206.84 GiB (11.7%) fs: ext4 dev: /dev/sda2 
           ID-3: /opt size: 58.42 GiB used: 2.45 GiB (4.2%) fs: ext4 dev: /dev/sda1 
Swap:      Alert: No Swap data was found. 
Sensors:   System Temperatures: cpu: 44.6 C mobo: N/A gpu: amdgpu temp: 56.0 C 
           Fan Speeds (RPM): N/A gpu: amdgpu fan: 1853 
Info:      Processes: 343 Uptime: 11m Memory: 15.65 GiB used: 1.66 GiB (10.6%) Init: systemd Compilers: gcc: 10.2.0 
           Packages: 1743 Shell: Zsh v: 5.8 inxi: 3.1.06
  • Linux kernel:
Linux 5.8.11-arch1-1
  • Latest packages:
amdgpu-clocks-git
amdgpu-dkms
amdgpu-tweakd-git
amdvlk
amf-headers
conky-lua
dkms
ffmpeg-amd-full-git
lib32-libdrm
lib32-libunwind
lib32-libva-mesa-driver 
lib32-mesa 
lib32-mesa-vdpau
lib32-vulkan-radeon 
lib32-wayland
libdrm
libva-mesa-driver
libvdpau
linux-amd
linux-amd-headers
linux-headers
mesa
mesa-vdpau
opengl-man-pages
vulkan-headers
vulkan-radeon
xf86-video-amdgpu

Not sure if it will help - but what the results from:
conky -v and lua -v
and I would not mind knowing what conky statement is showing these results? Is it a graph - or a gauge - or something else?

I’m assuming this system is used for gaming (mine is set up the other way around - 3700x and rx-580) so some research is needed at my end… :grin:

1 Like

@freebird54

  • conky
conky -v
conky 1.11.5_pre compiled sáb 26 set 2020 20:08:34 -03 for Linux 5.8.10-arch1-1 x86_64

Compiled in features:

System config file: /etc/conky/conky.conf
Package library path: /usr/lib/conky


 General:
  * math
  * hddtemp
  * portmon
  * IPv6
  * Curl
  * RSS
  * Weather (METAR)
  * wireless
  * support for IBM/Lenovo notebooks
  * builtin default configuration
  * old configuration syntax
  * Imlib2
  * OSS mixer support
  * apcupsd
  * iostats
  * ncurses
  * Internationalization support
  * PulseAudio

 Lua bindings:
  * Cairo
  * Imlib2
  * RSVG
 X11:
  * Xdamage extension
  * Xinerama extension (virtual display)
  * Xshape extension (click through)
  * XDBE (double buffer extension)
  * Xft
  * ARGB visual
  * Own window

 Music detection:
  * CMUS
  * MPD
  * MOC

 Default values:
  * Netdevice: eno1
  * Local configfile: $HOME/.conkyrc
  * Localedir: /usr/share/locale
  * Maximum netdevices: 256
  * Maximum text size: 16384
  * Size text buffer: 256
  • Lua:
Lua 5.4.0  Copyright (C) 1994-2020 Lua.org, PUC-Rio

1.11.5 shouldn’t be causing that kind of output that I can see - it only had troubles with ${execi} timings… 1.11.7 though, anything is possible!

If you aren’t seeing problems with the cairo built-in, lua 5.4 should be OK too. Hope someone with more gaming experience comes by, I’m off to do some research on the other stuff you’ve got loaded…

3 Likes

The official Conky uses 1.11.5. The conky-lua-nv uses 1.11.6, but it’s only for NVIDIA users. On Conky repository, they released only 1.11.6.

@freebird54, I installed conky-git, it seemed to fix Conky’s RAM memory leak bug.

I maked your answer as a solution, @freebird54, but the old ghost problem returned.

I use the conky-cairo package, which defaults to 1.11.3 - but allows you to specify which version you want. this includes the git version, which displays as 1.11.7. The PKGBUILD is set up to choose dependencies/bindings you wish to use (such as nVidia and Audacious). Having the nVidia bindings does not hurt its operation that I can detect on my AMD system - but I do leave it out given the choice! :grin: I have different builds on different distros (1.11.5 + lua 5.4 on EnOS, 1.11.7 + lua 5.4 on Arch, 1.11.3 + lua 5.3.5 on Arcolinux, 1.11.6 + lua 5.4 on Garuda). Conky cairo also pops a cou-ple of patches on the ‘newer’ versions - but I think they are only to fix the ${execi} problem…

Which ‘ghost’ problem is that? - doubled displays of some things? Double buffer not behaving? There some settings that interact unconventionally, especially with transparency enabled.

If I can just add, the thread you linked to that I posted was split off from another, and, in the other, I posted the solution, which in my case was unticking drivers in the ‘base and other packages’ which my system didn’t need, so I could install Endeavour. It looks from your list that you already did that on installing, and are far more tech-able than myself; I wouldn’t know if there were leaks, so well spotted! Could be the AMD drivers not fully finished yet? … or is that a dumb thing to say? :rofl: I’m running 8gig swap, and I think your printout shows no swap? I’m running the LTS kernel. Have never tried linux-amd; didn’t even know it existed, lol. Just noticing differences, incase anything gives a clue.

I refer to I have an issue with KDE's SDDM and i3lock-fancy's xidlehook.

It’s what I thought. When I noticed something wrong with the RAM memory, I have searched, I saw I am in the same boat that the AMD RX 5700XT of Linux who had the same bug.

But @freebird54 indicated Conky as guilty of the bug.

I used still linux. But the linux-amd is installed. I tested with the mirror mesagit, no bugs, but if the bug appears, I’ll report.

1 Like

Yes, it easily could be conky, or a combination of things e.g. the amd kernel with conky, or something unique to a certain hardware combination, where actually the lts kernel would help.

Probably a big thing to do, but have you run a system without conky and with just the linux-lts? If the error is still happening then, on a vanilla system, we’ll be able to home in on what it could be (I say ‘we’, but I’m not very tech-able, whereas plenty of great people here are). Sometimes these adapted kernels can throw some errors, or may bring in changes that alter things e.g. I was using linux-zen until recently, but more intel patches have been included, and I changed to the LTS and am seeing no difference; system runs fine.

If at all possible, I’d suggest running a vanilla system … linux-lts, no conky, normal mesa (I run wine-staging now too, instead of tkg wine, and, again, seeing no difference and things run fine). Then, if it’s the kernel or conky that were the issue, that’ll come clear, and, if not, it’s easier to home in on what could be the issue e.g. test ram etc. Could even just be a loose connector or something. I hesitate to recommend changing bios, as that can introduce issues as much as it can fix them, but possibly worth a look into that. It could even be a desktop environment or browser bug.

1 Like

I had normal mesa with upgrade Conky, under linux – no bugs.

But I will test with linux-lts and normal mesa without starting the upgrade Conky.

1 Like

Sounds like a good plan. :grinning: :+1:t2:

@anon96036739, here is.

Kernels Test with AMD RX 5700XT

Kernel OpenCL Problems With Conky Wihout Conky
linux mesa
  • Only Conky 1.11.5 had a RAM memory leak.
  • The loading of apps and of pages on a browser is slow.
  • If you compile via makepkg or via AUR, it will consume all the CPU usage.
1.11.5: RAM memory leak.
1.11.7: No bugs.
RAM memory leak and slowness.
linux mesa-git
  • Only Conky 1.11.5 had a RAM memory leak.
  • Only the loading of Tilix is slow.
1.11.5: RAM memory leak.
1.11.7: No bugs.
Slow load of apps and of browser pages.
linux-lts mesa
  • Only Conky 1.11.5 had a RAM memory leak.
  • The load of pages on the browser is very slow.
  • The compilation via makepkg consumes only 17% of CPU.
1.11.5: RAM memory leak.
1.11.7: No bugs.
No system bugs.
linux-lts mesa-git
  • Only Conky 1.11.5 had a RAM memory leak.
  • Only the loading of Tilix is slow.
1.11.5: RAM memory leak.
1.11.7: No bugs.
No system bugs, except the slowness of Tilix.
linux-amd mesa
  • Only Conky 1.11.5 had a RAM memory leak.
  • No slowness.
  • The CPU usage is the least consumed.
  • Only ethernet/Wifi bug, as the internet is disconnected.
1.11.5: RAM memory leak.
1.11.7: No bugs.
Ethernet/wifi bug.
linux-amd mesa-git
  • Only Conky 1.11.5 had a RAM memory leak.
  • Only the loading of Tilix is slow.
  • The CPU usage is enough consumed.
  • Only ethernet/Wifi bug, as the internet is disconnected.
  • The slow reboot.
  • It disabled NetworkManager, affecting all the kernels and OpenCLs.
1.11.5: RAM memory leak.
1.11.7: No bugs.
Ethernet/wifi bug and slowness of Tilix.
  • Bootloader:
    • Quicker almost on all kernels and OpenCLs, except the linux and mesa.
  • SDDM login screen:
    • It does not start the SDDM even if I have already did the command sudo systemctl enable sddm. Buggy in almost all the kernels and OpenCLs.
  • Lock screen:
  • Sway:
    • Totally buggy as it does not show up the bar (waybar and wofi) in almost all the kernels and all the OpenCLs. (Solved)
1 Like

Best testing I’ve ever seen anybody do; well done! :+1:t2:

To my untrained eye, and from what you’ve posted, It looks like only bug fixes will sort conky, and sddm/lock screen. Running the LTS and mesa-git, without conky and with a different desktop environment, at the moment, looks to be the ticket to as trouble-free a time while waiting for fixes, which is bad, but at least you can get on with using your computer. I don’t run KDE or conky (am on Mate/Lightdm, plus LTS/mesa/wine-staging), so unfortunately can’t compare, but, with particularly the SDDM bug being so bad, fixes could come through quickly. :crossed_fingers:t2:

That’s interesting. Using Valgrind package.

valgrind --leak-check=yes plasmashell

it seems that sway default config comes with the packages is faulty

1 Like

I ran the errands to investigate the bugs, errors and failures in Sway. I found that it was Redshift and wayland-egl. Sway does not recognise that wayland-egl, even if egl-wayland is installed. I replaced it with xwayland. But Redshift did n’t recognise wayland-egl or xwayland, I decided to simplify redshift-gtk -m xwayland to just redshift.

My .{x,p,z}profile was:

# QT settings
# Configurações do QT

export QT_AUTO_SCREEN_SCALE_FACTOR=0

if [ "$DESKTOP_SESSION" == "i3" ] || [ "$XDG_CURRENT_DESKTOP" == "i3" ] || 
	 [ "$DESKTOP_SESSION" == "i3-with-shmlog" ] || [ "$XDG_CURRENT_DESKTOP" == "i3-with-shmlog" ] || 
	 [ "$DESKTOP_SESSION" == "/usr/share/xsessions/i3-with-shmlog" ] || [ "$XDG_CURRENT_DESKTOP" == "/usr/share/xsessions/i3-with-shmlog" ];	then
	export QT_QPA_PLATFORM=xcb
else
	export QT_QPA_PLATFORM=wayland-egl
fi

export QT_QPA_PLATFORMTHEME=qt5ct
export QT_STYLE_OVERRIDE=kvantum

And now:

# QT settings
# Configurações do QT

export QT_AUTO_SCREEN_SCALE_FACTOR=0

if [[ "$DESKTOP_SESSION" == "i3" ]] && [[ "$XDG_CURRENT_DESKTOP" == "i3" ]] && 
   [[ "$DESKTOP_SESSION" == "/usr/bin/i3" ]] && [[ "$XDG_CURRENT_DESKTOP" == "/usr/bin/i3" ]] && 
   [[ "$DESKTOP_SESSION" == "i3-with-shmlog" ]] && [[ "$XDG_CURRENT_DESKTOP" == "i3-with-shmlog" ]] && 
   [[ "$DESKTOP_SESSION" == "/usr/bin/i3-with-shmlog" ]] && [[ "$XDG_CURRENT_DESKTOP" == "/usr/bin/i3-with-shmlog" ]] && 
   [[ "$DESKTOP_SESSION" == "/usr/share/xsessions/i3" ]] && [[ "$XDG_CURRENT_DESKTOP" == "/usr/share/xsessions/i3" ]] && 
   [[ "$DESKTOP_SESSION" == "/usr/share/xsessions/i3-with-shmlog" ]] && [[ "$XDG_CURRENT_DESKTOP" == "/usr/share/xsessions/i3-with-shmlog" ]]; then
	export QT_QPA_PLATFORM=xcb
else
	export QT_QPA_PLATFORM=xwayland
fi

export QT_QPA_PLATFORMTHEME=qt5ct
export QT_STYLE_OVERRIDE=kvantum

Sway is working now.

With that you’ll always do

export QT_QPA_PLATFORM=xwayland

Then that must be right!
:wink: