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

Reclaim native memory quicker when using ZlibCompressor #1285

Merged
merged 2 commits into from Jan 10, 2024

Conversation

raelg
Copy link
Contributor

@raelg raelg commented Dec 28, 2023

Reclaim native memory quicker by overriding close() to invoke end() on the deflater, since by supplying a deflater to the constructor of DeflaterOutputStream usesDefaultDeflater is set to false and therefore end() is not invoked in DeflaterOutputStream#close.

This is related to JDK-4797189 bug/feature (marked as Won't Fix)

See the following blog post for more information: https://medium.com/swlh/native-memory-the-silent-jvm-killer-595913cba8e7

JAVA-5280

…n the deflater, since by supplying a deflater to the constructor of DeflaterOutputStream usesDefaultDeflater is set to false and therefore end() is not invoked in DeflaterOutputStream#close.
@jyemin
Copy link
Contributor

jyemin commented Jan 5, 2024

Hi @raelg , I opened JAVA-5280 and linked this PR to it. We'll take a look soon.

Copy link
Contributor

@jyemin jyemin left a comment

Choose a reason for hiding this comment

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

Looks good. Just one whitespace issue to fix.

@jyemin jyemin merged commit d80e9c1 into mongodb:master Jan 10, 2024
4 of 11 checks passed
jyemin pushed a commit that referenced this pull request Jan 10, 2024
Reclaim native memory quicker by overriding close() on DeflaterOutputStream to invoke end() on the Deflater, since by supplying a deflater to the constructor of DeflaterOutputStream usesDefaultDeflater is set to false and therefore end() is not invoked in DeflaterOutputStream#close.

JAVA-5280
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants