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: gzip Bijection resource leak. #193

Merged
merged 1 commit into from
Jan 10, 2015
Merged

Conversation

plaflamme
Copy link
Contributor

GZIPOutputStream#finish() does not relinquish all resources.

Specifically the Deflater instance used internally will release resources when end() called which only happens on close() or when finalize() is invoked by the garbage collector.

Thus, the use of finish() without close() relies on finalizers to cleanup resources which is a Bad Thing(tm).

The same logic was applied to the reverse Bijection.

GZIPOutputStream#finish() does not relinquish all resources.

Specifically the Deflater instance used internally will release resources when end() called which only happens on close() or when finalize() is invoked by the garbage collector.

Thus, the use of finish() without close() relies on finalizers to cleanup resources which is a Bad Thing(tm).

The same logic was applied to the reverse Bijection.
@ianoc
Copy link
Collaborator

ianoc commented Jan 10, 2015

Looks great, thanks for the contribution

ianoc added a commit that referenced this pull request Jan 10, 2015
FIX: gzip Bijection resource leak.
@ianoc ianoc merged commit 44c4390 into twitter:develop Jan 10, 2015
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