RFR: 8354872: Clarify java.lang.Process resource cleanup [v2]

Roger Riggs rriggs at openjdk.org
Fri Jun 27 19:06:22 UTC 2025


> Improve the documentation of Process use of system resources.
> 
> Describe the implementation closing streams when no longer referenced.
> Clarify the interactions between inputStream and inputReader and errorStream and errorReader.
> Add advice and example using try-with-resources to open and close streams.
> Recommend closing streams when no longer in use.

Roger Riggs has updated the pull request incrementally with two additional commits since the last revision:

 - Revised Process and ProcessBuilder doc with reviewer suggestions.
   And copyrights.
 - Update example to use Reader.allAllLines() and simplify passing args to the ProcessBuilder constructor.
   Plus copyright update

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/25884/files
  - new: https://git.openjdk.org/jdk/pull/25884/files/5fdd6101..8be5b028

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=25884&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25884&range=00-01

  Stats: 64 lines in 2 files changed: 35 ins; 11 del; 18 mod
  Patch: https://git.openjdk.org/jdk/pull/25884.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25884/head:pull/25884

PR: https://git.openjdk.org/jdk/pull/25884


More information about the core-libs-dev mailing list