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

fix memory leak on incor calc of cleanup bucket #429

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

flymedllva
Copy link
Contributor

@flymedllva flymedllva commented Dec 26, 2024

cleanup now does not try to clean an empty bucket selected by the cleanup algorithm

this fixes a critical problem of slice growth when the algorithm incorrectly calculates the buckets that need to be cleared, let's say this behavior occurs at the time change described in issue: #426

this problem appeared after improving cleanup in this pr: #358

most likely the algorithm for calculating the cleaning bins also needs to be revised, but for me now it is important to fix the increase in memory consumption when changing the system time

@flymedllva flymedllva requested a review from a team as a code owner December 26, 2024 00:16
mangalaman93
mangalaman93 previously approved these changes Dec 26, 2024
@mangalaman93 mangalaman93 enabled auto-merge (squash) December 26, 2024 05:39
@flymedllva flymedllva force-pushed the fix-memory-leak-on-incor-calc-of-cleanup-bucket branch from 0507668 to 4b34a22 Compare December 27, 2024 10:08
@mangalaman93
Copy link
Contributor

@flymedllva Thank you for the PR. The ci passes. is it possible to write a test for the issue?

cleanup does not try to clean empty bucket
@flymedllva flymedllva force-pushed the fix-memory-leak-on-incor-calc-of-cleanup-bucket branch from c61ba03 to 89d19c9 Compare December 27, 2024 21:42
@flymedllva
Copy link
Contributor Author

I couldn't find a direct test for cleanup, so I made one and included in its implementation a sub-check that caused the slice to grow uncontrollably without allowing cleanup to terminate. With the fix, this test passes.

@flymedllva flymedllva force-pushed the fix-memory-leak-on-incor-calc-of-cleanup-bucket branch from 89d19c9 to dc92bd6 Compare December 27, 2024 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants