Skip to content

[query] Fix memory leak of relational keys in native writers #12574

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

Merged

Conversation

chrisvittal
Copy link
Collaborator

In order to track partition bounds and distinctness, we report the first and last seen keys when writing (matrix) tables. Previously we were copying the last seen key into the partition region. This is incorrect as the partition region has a lifetime of the entire partition and cannot be cleared, leaking memory. Fix this by giving the last seen key its own region that can be cleared before a new last seen key is saved.

Tested manually.
See the following zulip thread for initial report.
https://hail.zulipchat.com/#narrow/stream/123011-Hail-Query-Dev/topic/memory.20usage.20by.20range.20-.3E.20write/near/316404073

In order to track partition bounds and distinctness, we report the first
and last seen keys when writing (matrix) tables. Previously we were
copying the last seen key into the partition region. This is incorrect
as the partition region has a lifetime of the entire partition and
cannot be cleared, leaking memory. Fix this by giving the last seen key
its own region that can be cleared before a new last seen key is saved.
@danking danking merged commit 2ba8c23 into hail-is:main Jan 4, 2023
@chrisvittal chrisvittal deleted the query/last-seen-key-distinct-region branch January 5, 2023 01:09
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.

3 participants