RFR: 8354872: Clarify java.lang.Process resource cleanup

Volkan Yazici vyazici at openjdk.org
Mon Jun 23 20:19:29 UTC 2025


On Wed, 18 Jun 2025 20:16:18 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

> 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.

The addendum on resource management looks very useful, thanks! 💯

Shall we also

1. Create a dedicated section on resource management
2. Document the effect of `destroy()` and `destroyForcibly()` (and `onExit()`?) on releasing resources

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

PR Review: https://git.openjdk.org/jdk/pull/25884#pullrequestreview-2951417760


More information about the core-libs-dev mailing list