Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8147615

(fc) FileChannelImpl has no finalizer

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 10
    • None
    • core-libs
    • None
    • b27

      FileChannelImpl does not have a finalizer. As a result, if one becomes garbage without being closed, the file descriptor stays open until the JVM terminates.

      Various Stream factories (Files.lines, Files.walk) are ultimately backed by a FileChannelImpl. If the user does not close the stream, then the FCI is leaked and therefore the file descriptor is leaked.

            bpb Brian Burkhalter
            briangoetz Brian Goetz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: