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

Avoid unintended garbage collection of raw data in PreparedDictionaryImpl #190

Merged
merged 3 commits into from
Nov 27, 2024

Conversation

bwollmer
Copy link
Contributor

Motivation:

As described in #189 the garbage collection currently removes the data from the dictionary, resulting in poor compression ratios, since no dictionary was actually used.
The code to finalize the rawData already exists.

Modification:
Hold the reference on rawData in PreparedDictionaryImpl

Result:
Fixes #189.

hyperxpro
hyperxpro previously approved these changes Nov 26, 2024
Copy link
Owner

@hyperxpro hyperxpro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@hyperxpro
Copy link
Owner

Can you add a test case as well? I know this is complicated but you can create GC pressure to trigger GC collection.

@bwollmer
Copy link
Contributor Author

Good point! The GC pressure seems to do the trick for the test. It consistently fails on the old code but works on the updated code.

@hyperxpro hyperxpro changed the title Avoid unintend garbage collection of raw data in PreparedDictionaryImpl Avoid unintended garbage collection of raw data in PreparedDictionaryImpl Nov 27, 2024
@hyperxpro hyperxpro merged commit f280107 into hyperxpro:main Nov 27, 2024
27 checks passed
@hyperxpro
Copy link
Owner

Thanks a lot! :)

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.

[BUG] PreparedDictionaryImpl data gets removed by garbage collection
2 participants