Request for review : 7181793 FileDescriptor keeps its own hard reference to Closeables causing a memory leak

Seán Coffey sean.coffey at
Tue Jul 10 16:37:47 UTC 2012

7105952 fix introduced some improvements for finalization strategy 
around FileInputStream/FileOutputStream/RandomAccessFile.

However a recently reported issue has highlighted an issue where memory 
heap can be consumed with SocketOutputStream objects as a result of 
clients repeatedly calling socket.getOutputStream() on a common socket 
(shared fd).

Use of weakreferences was considered at 7105952 fix time but hard 
references was considered a cleaner approach. Altering that design at 
this late stage in the 7u6 plan could be risky and I'm suggesting that 
we back out the 7105952 fix and concentrate on this area again in 7u8.

The changeset is basically a backout of the original changeset plus the 
addition of a new testcase ( 

Once reviewed, I'll ping 7u openjdk alias to start the critical fix 
approval process.

More information about the core-libs-dev mailing list