Hi Roger,

Looks good to me - but I'd suggest to call fullGC at least once
before waiting on the semaphore (e.g. add a call to whitebox.fullGC()
when entering checkCleaned() before line 285).
That might maximize the chances that the referred object will be
GC'ed before you start waiting on the semaphore.

Also I wonder whether you should raise the timeout in tryAcquire, 10ms
is not much - and you want to give enough time so that the cleaner's
thread is scheduled and calls the cleanup action...
Maybe you could make that timeout depending on the timeoutFactor
as well.

best regards,

-- daniel

On 29/01/16 19:47, Roger Riggs wrote:
Please review a fix for two test issues.  When run with -Xcomp and other
switches that change
GC behavior; the CleanerTest was not giving enough to time to see the
result of cleaning.
Also, added an adjustment of the number of cycles by the timeoutFactor.

Webrev:
   http://cr.openjdk.java.net/~rriggs/webrev-cleanertest-8146773/

8146773: java/lang/ref/CleanerTest.java CleanerTest.testRefSubtypes() fails
8148352: CleanerTest fails: Cleanable should have been freed

Thanks, Roger



Reply via email to