Patch: close I/O channels when a process ends

Bryce McKinlay mckinlay@redhat.com
Sun Aug 8 16:46:00 GMT 2004


David Daney wrote:

>I think once you have obtained a stream from the Process, it is your
>responsibility to close it if you don't want to wait for the finalizer
>to close it for you.  They are just like any other IO object in this
>respect.
>
>I agree that the streams that were never obtained from the Process
>probably should be closed.
>  
>

I agree, I think this is the best approach. There is a side-issue of 
making sure that FDs get cleaned up in a timely manner so that we don't 
run out when sloppy programmers don't call close(): finalizers are not 
reliable for this. But, this is a general problem which applies to all 
streams, sockets, etc, not just to Process.

Regards

Bryce
 



More information about the Java-patches mailing list