-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
None
As reported on the mailing list: https://mail.openjdk.org/pipermail/serviceability-dev/2025-May/063907.html
sun.tools.attach.VirtualMachineImpl#checkCatchesAndSendQuitTo is not following the API Note advice in java.nio.file.Files for the lines() method.
final var cmdline = Files.lines(procPid.resolve("cmdline")).findFirst();
https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/nio/file/Files.html#lines(java.nio.file.Path)
API Note:
This method must be used within a try-with-resources statement or similar control structure to ensure that the stream's open file is closed promptly after the stream's operations have completed.
sun.tools.attach.VirtualMachineImpl#checkCatchesAndSendQuitTo is not following the API Note advice in java.nio.file.Files for the lines() method.
final var cmdline = Files.lines(procPid.resolve("cmdline")).findFirst();
https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/nio/file/Files.html#lines(java.nio.file.Path)
API Note:
This method must be used within a try-with-resources statement or similar control structure to ensure that the stream's open file is closed promptly after the stream's operations have completed.
- duplicates
-
JDK-8358077 sun.tools.attach.VirtualMachineImpl::checkCatchesAndSendQuitTo on Linux leaks file handles after JDK-8327114
-
- In Progress
-