code review request: Test case for JDK-7042126 HashMap.clone() memory leak

Alan Bateman Alan.Bateman at
Wed Jan 30 13:09:12 UTC 2013

On 29/01/2013 23:36, David Buck wrote:
> Hi!
> This is a review request to add only the test case for the following 
> OracleJDK issue :
> [ 7042126 : (alt-rt) HashMap.clone implementation should be re-examined ]
> * please note: I just marked the bug as "public" this morning, so 
> there will be a short delay before the above link is available.
> The issue (root cause) is not in OpenJDK (i.e. the problem was 
> OracleJDK specific), but the test case is valid for any Java SE 
> implementation so it should go into OpenJDK so we can prevent a 
> similar issue from ever happening in both releases moving forward. The 
> test case simply helps ensure that the contents of a HashMap are not 
> leaked when we clone the HashMap.
> webrev:
> [ Code Review for jdk ]
How robust is this test? I'm concerned that it might fail intermittently 
if the System.gc doesn't immediately GC the now un-references entries in hm.

Minor nit, should be WeakReference<Object> to avoid the raw type.


More information about the core-libs-dev mailing list