RFR: 8187831: Add stress test for clearing weak references

Kim Barrett kim.barrett at oracle.com
Fri Sep 22 18:54:01 UTC 2017

> On Sep 22, 2017, at 11:07 AM, Erik Helin <erik.helin at oracle.com> wrote:
> Hi all,
> I would like to add a new stress test that stresses clearing of weak references. From the comment in the test code:
> // Tests that weak references are cleared. In this test case, the parent
> // pointed from an instance of F to its TestFinalizer parent provokes an
> // unusual situation, similar to the one found in ZipFile/Inflator.
> Patch:
> http://cr.openjdk.java.net/~ehelin/8187831/00/
> Enhancement:
> https://bugs.openjdk.java.net/browse/JDK-8187831
> Testing:
> - Run test successfully on Linux x86-64
> Thanks,
> Erik


Sorry, but I found the bug description and the test description pretty
much indecipherable.  I had to study the code to have any guess as to
what is being tested here.

I *think* what is being tested is that a weak reference (from a
WeakHashMap) to a finalizable object will be cleared before the
object's finalize method is executed.

  55                 count--;

I don't understand the point of count in this test, especially with
this decrement.


More information about the hotspot-gc-dev mailing list