timlau / yumex-ng

Yum Extender NG
GNU General Public License v3.0
48 stars 2 forks source link

yumex_updater_systray memory leak (dnf5) #80

Open timlau opened 2 weeks ago

timlau commented 2 weeks ago

When running an update check with expired metadata not all allocated memory is released after the check is executed.

It is not only when running the build-in metadata expire, running

dnf5 clean expire-cache

also trigger the issue, every time metadata is downloaded during the check then a little extra memory is used.

newplot(1)

timlau commented 2 weeks ago

How to reproduce Install Requirement

sudo dnf install python3-memray

cd to git checkout

make memray-updater-live

In a terminal run

dbus-send --session --print-reply  --dest=dk.yumex.UpdateService /dk/yumex/UpdateService dk.yumex.UpdateService.RefreshUpdates boolean:false
dbus-send --session --print-reply  --dest=dk.yumex.UpdateService /dk/yumex/UpdateService dk.yumex.UpdateService.RefreshUpdates boolean:false
dnf5 clean expire-cache
dbus-send --session --print-reply  --dest=dk.yumex.UpdateService /dk/yumex/UpdateService dk.yumex.UpdateService.RefreshUpdates boolean:false

watch the heap memory dont settle at the same level if metadata is refreshed

timlau commented 2 weeks ago

testing using the build-in metadata expire

dbus-send --session --print-reply  --dest=dk.yumex.UpdateService /dk/yumex/UpdateService dk.yumex.UpdateService.RefreshUpdates boolean:true
timlau commented 2 weeks ago

Looks like it is a memory leak in dnf5 https://github.com/timlau/apitest/blob/main/dnf5/mem_updates.py

timlau commented 2 weeks ago

created dnf5 upstream issue https://github.com/rpm-software-management/dnf5/issues/1561