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

memory leak in update_and_load_enabled_repos() (Python) #1561

Closed
timlau opened this issue Jun 25, 2024 · 3 comments
Closed

memory leak in update_and_load_enabled_repos() (Python) #1561

timlau opened this issue Jun 25, 2024 · 3 comments
Assignees

Comments

@timlau
Copy link

timlau commented Jun 25, 2024

It looks like there is some memory there is not released when calling package_sack.update_and_load_enabled_repos(True)
from python when the cache is expired.
I have created some test code located here
https://github.com/timlau/apitest/tree/main/dnf5/memleak

it does some basic dnf5 setup and get the number of updates and clean up the base each time
with a fresh cache it run 3x and memory is released each time.

If I run "dnf5 clean expire-cache" before running the same code, the amount of allocated memory is increased at each run

Tested on dnf5.x86_64 5.1.17-1.fc40

I use python3-memray to track the memory usage

test

@kontura
Copy link
Contributor

kontura commented Jul 19, 2024

Thanks for the report and for the test code.

I was able to track it down mostly to the use of zchunk in librepo.
If zchunk is turned of (there is an option in dnf.conf) the leaks go away.

I made a couple PRs to improve the situation:
rpm-software-management/librepo#322
zchunk/zchunk#108

@timlau
Copy link
Author

timlau commented Jul 29, 2024

Thanks for looking into the issue

@kontura
Copy link
Contributor

kontura commented Aug 5, 2024

The PRs have been merged.
The issue should be resolved.

@kontura kontura closed this as completed Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants