RFR (L): 8213229: Investigate treating StringTable as weak in young collections

Thomas Schatzl thomas.schatzl at oracle.com
Fri Jan 25 10:49:07 UTC 2019


Hi again,

On Thu, 2019-01-24 at 13:55 +0100, Thomas Schatzl wrote:
> On Wed, 2019-01-23 at 23:07 -0500, Kim Barrett wrote:
> > > 
> > [...]

> > src/hotspot/share/gc/shared/weakProcessor.inline.hpp
> >   51     bool result = _inner->do_object_b(obj);
> >   52     _num_dead += !result;
> > 
> >   57   size_t num_dead() const { return _num_dead; }
> > 
> > This calculates the number of recently deceased, and does not
> > include entries that were nulled out by some previous collection
> > but not yet removed by the service thread.  But the calculations
> > based on:
> > 
> >   89       StringTable::inc_dead_counter(cl.num_dead());
> > 
> > want the number of nulled out entries.
> > 
> > I don't see a convenient way to obtain the number that should be
> > passed to inc_dead_counter here, at least not while using
> > weak_oops_do.  What I think needs to be passed to inc_dead_counter
> > is the number of previously nulled entries + the number of newly
> > dead entries.  Using oops_do rather than weak_oops_do would allow
> > getting the missing number.
> > 
> > The serial WeakProcessor has the same problem.
> > 
> > We talked about this offline last week, and I think we got it
> > wrong. I was working with what I remembered of that part of the
> > StringTable API, and it looks like my memory was faulty.  Sorry
> > about that.
> 
> From what I understand this is actually an existing bug - the old
> code (in StringTable) also directly set
> StringTable::_uncleaned_items_count as returned by the count of the
> IsAliveClosure in weak_oops_do().
> 
> I would prefer fixing this separately as I believe the exact way to
> do this best will be another discussion. I can file a CR for that.

While looking into this as part of JDK-8217778 I found that I forgot to
remove the now unused StringTableIsAliveCounter class.

Removed that as well and regenerated the webrevs at:

> 
> New webrevs at:
> http://cr.openjdk.java.net/~tschatzl/8213229/webrev.2_to_3/ (diff)
> http://cr.openjdk.java.net/~tschatzl/8213229/webrev.3/ (full)
> Testing:
> locally running gc/g1, started hs-tier1-5
> 

hs-tier1-5 passed w/o issues in the meantime.

Thanks,
  Thomas




More information about the hotspot-gc-dev mailing list