RFR (S): 8227671: G1: assert_used_and_recalculate_used_equal performs work in product builds

Thomas Schatzl thomas.schatzl at oracle.com
Mon Jul 15 18:22:30 UTC 2019


Hi Sangheon,

  thanks for your review.
  
On Mon, 2019-07-15 at 10:57 -0700, sangheon.kim at oracle.com wrote:
> Hi Thomas,
> 
> On 7/15/19 8:38 AM, Thomas Schatzl wrote:
> > Hi all,
> > 
> >    can I have reviews for this small change that avoids doing
> > unneccessary work in product builds?
> > 
> > In particular, the assert_used_and_recalculate_used_equal macro
> > executes code (the recalculate_used() call) that is potentially
> > lengthy.
> > 
> > I measured a few ms on a large heap (50GB) with (forced) 50k
> > regions. I am not sure why this call is so expensive in my tests,
> > but it is completely unnecessary.
> 
> It is expensive because recalculate_used() iterates all heap regions?

That's true, however the time it takes is still imho unreasonably high
(but it should be fixed in any case).

> > 
> > CR:
> > https://bugs.openjdk.java.net/browse/JDK-8227671
> > Webrev:
> > http://cr.openjdk.java.net/~tschatzl/8227671/webrev/
> 
> Looks good to me and thanks for fixing this!

Thanks for looking into this so quickly!

> 
> > Testing:
> > Currently running hs-tier1-3, local gc/g1 jtreg run, local
> > benchmarks
> > 

Testing almost done, with no issues.

Thanks,
  Thomas




More information about the hotspot-gc-dev mailing list