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();
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();
- duplicates
-
JDK-8130331 (fs) Files.list().forEach() leaks native memory on Windows
-
- Closed
-