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

Alan Bateman Alan.Bateman at oracle.com
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 ]
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7042126
>
> * 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 ]
> http://cr.openjdk.java.net/~dbuck/7042126/webrev.00/
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.

-Alan.



More information about the core-libs-dev mailing list