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

(fc) FileChannelImpl has no finalizer

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b27

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: