Patch review request - Test bug 7123972 test/java/lang/annotation/loaderLeak/Main.java fails intermittently
Alan Bateman
Alan.Bateman at oracle.com
Thu Jun 21 10:18:34 UTC 2012
On 21/06/2012 07:05, Eric Wang wrote:
> Hi All,
>
> I come from Java SQE team who are interested in regression test bug
> fix. Here is the first simple fix for bug 7123972
> <http://monaco.us.oracle.com/detail.jsf?cr=7123972>, Can you please
> help to review and comment? Attachment is the patch Thanks!
>
> This bug is caused by wrong assumption that the GC is started
> immediately to recycle un-referenced objects after System.gc() called
> one or two times.
>
> The proposed solution is to make sure the un-referenced object is
> recycled by GC before checking if the reference is null.
>
> Regards,
> Eric
You should also remove the test from the exclude list
(jdk/test/ProblemList.txt) so that it will be run again.
Otherwise the change looks okay to me. I agree with David's comments
that you could invoke runFinalization. I would also suggest increasing
the sleep time from 5ms so that it's not spinning calling System.gc. A
minor comment is that "while(false==GCIndicator)" looks a bit odd, maybe
rename the flag to "finalized" and change it to "while (!finalized) {
... }".
-Alan.
More information about the core-libs-dev
mailing list