Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move to Files.new* creation of I/O streams during IDE boot
FileOutputStream and FileInputStream complicate GC because they both override `#finalize()`. Switching to NIO API creates Stream without finalizers and thus relieving GC.
- Loading branch information
1 parent
dfcc859
commit 4b82e6a
Showing
20 changed files
with
165 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
4b82e6a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this bug might be related to this: https://issues.apache.org/jira/browse/NETBEANS-583
(Switching to NIO means ClosedByInterruptException can now be thrown in various places.)
4b82e6a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking over a few of the places touched in this commit, it seems a more cautious approach is needed; the ClosedByInterruptException must always be handled somehow. The options are:
I think (4) is the best option here. But it would need to be implemented as custom "non-interruptible" FileInputStream/FileOutputStream that wraps the NIO ones, as in some cases the stream objects are exposed via public APIs. Even when stream objects are not exposed via public APIs, changing every place that uses a NIO FileInputStream/FileInputStream to incorporate the retry logic, as was done in #854 for JarClassLoader, would clutter up a lot of code unnecessarily.
A final option is to just revert to the old FileInputStream/FileOutputStream classes. Was there a significant performance benefit to avoiding them?