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

Replace FileOutputStream by nio Files.newOutputStream and Channels.newOutputStream #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ghost
Copy link

@ghost ghost commented Sep 24, 2017

This patch reduces GC pressure.

FileOutputStream contains a finalizer which can cause excessive garbage
collector pressure when writing many TAR files.

Finalizers are only executed when the GC feels like it. Until they are
executed, objects with finalizers are not garbage collected. Internal
benchmarks have shown that hundreds of thousands of FileOutputStream
objects could remain in memory for a very long time as a result.

We've been using this internally for a few months, without any issues.

…wOutputStream

FileOutputStream contains a finalizer which can cause excessive garbage
collector pressure when writing many TAR files.

Finalizers are only executed when the GC feels like it. Until they are
executed, objects with finalizers are not garbage collected. Internal
benchmarks have shown that hundreds of thousands of FileOutputStream
objects could remain in memory for a very long time as a result.

This patch reduces GC pressure.
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.

1 participant