Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yumex_updater_systray memory leak (dnf5) #80

Closed
timlau opened this issue Jun 24, 2024 · 9 comments
Closed

yumex_updater_systray memory leak (dnf5) #80

timlau opened this issue Jun 24, 2024 · 9 comments
Assignees
Labels
bug Something isn't working dnf5 related to the dnf5 backend upstream

Comments

@timlau
Copy link
Owner

timlau commented Jun 24, 2024

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
Copy link
Owner Author

timlau commented Jun 24, 2024

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
Copy link
Owner Author

timlau commented Jun 24, 2024

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
Copy link
Owner Author

timlau commented Jun 24, 2024

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

@timlau
Copy link
Owner Author

timlau commented Jun 25, 2024

created dnf5 upstream issue
rpm-software-management/dnf5#1561

@timlau timlau self-assigned this Jun 25, 2024
@timlau timlau added bug Something isn't working dnf5 related to the dnf5 backend labels Jun 25, 2024
@timlau
Copy link
Owner Author

timlau commented Jul 29, 2024

there is an upstream librepo PR for a solution to the memory leak

@timlau
Copy link
Owner Author

timlau commented Aug 7, 2024

PR is added upstream

@timlau
Copy link
Owner Author

timlau commented Aug 7, 2024

the fix will be available in librepo > 1.18.0

@timlau
Copy link
Owner Author

timlau commented Aug 22, 2024

the fix has been released and pushed to Fedora 40
https://github.com/rpm-software-management/librepo/releases/tag/1.18.1

@timlau
Copy link
Owner Author

timlau commented Aug 22, 2024

looks like it fixed the memory leak in dnf

@timlau timlau closed this as completed Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dnf5 related to the dnf5 backend upstream
Projects
None yet
Development

No branches or pull requests

1 participant