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

Files.list - file handle leak

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 8u11
    • core-libs
    • x86_64
    • windows_7

      FULL PRODUCT VERSION :
      Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
      java version "1.8.0_11"
      Java(TM) SE Runtime Environment (build 1.8.0_11-b12)
      Java HotSpot(TM) Client VM (build 25.11-b03, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      Files.list() doesn't release open file handles.




      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      run Files.list() on Windows

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      after execution the above code open file handles should be released
      ACTUAL -
      Java doesn`t realease file handles

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public class FileList {
          public static void main(String[] args) throws IOException {
              for (int i = 0; i < 10000; i++) {
                  for (int j = 0; j < 10000; j++) {
                      Files.list(Paths.get("c:/"));
                  }
              }
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      use old java.io code: Paths.get("c:/").toFile().listFiles();

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: