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 issue in PriorityQueue Slice method #136

Closed
wants to merge 1 commit into from

Conversation

Gentleelephant
Copy link

@Gentleelephant Gentleelephant commented Jul 25, 2024

Motivation

  • Fixes potential memory retention issue in PriorityQueue Slice method.
  • In Go, slices share the same underlying memory block. This means that even if we are only interested in a small subset of the data, the entire array is kept in memory. In scenarios with unbounded streams, this could result in significant memory not being reclaimed.

Modifications

  • Updated the Slice method to create a new slice and copy the relevant elements.
  • This change ensures better memory management without altering the method’s functionality.

Verify change

  • Make sure the change passes the CI checks.

@reugn
Copy link
Owner

reugn commented Jul 29, 2024

@Gentleelephant, thanks for bringing this up. While reviewing the pull request, I have discovered more issues in the sliding window implementation. Therefore, it has been decided to refactor and entirely remove the use of the priority queue from the component. See #137.

@reugn reugn closed this Aug 3, 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

Successfully merging this pull request may close these issues.

2 participants