RFR (XS): 8211123: GC Metaspace printing after full gc does not reflect recent changes (Was: Re: A Bug Of Metaspace After Full GC)

JC Beyler jcbeyler at google.com
Thu Sep 27 02:21:16 UTC 2018


Hi Thomas et al,

Thanks for moving this thread to a RFR. Here is the webrev and bug:
Webrev: http://cr.openjdk.java.net/~jcbeyler/8211123/webrev.00/
Bug: https://bugs.openjdk.java.net/browse/JDK-8211123

For the test, I inspired myself of a few different tests to get this up and
running. I didn't find a means to use only the WhiteBox to get the
metaspace filled. I did not want to use the .jar that the original
reproducer was using since it was using a library. So I used the
testcases.jar from the runtime/7116786 test.

I also use a separate process to test the various GCs and ensure it works
for all.

Btw, I've put nijiaben as the contributor for the webrev.

Let me know what you think, I imagine I've made the test a bit more
complicated than need be,
Jc


On Wed, Sep 26, 2018 at 1:11 AM Thomas Schatzl <thomas.schatzl at oracle.com>
wrote:

> Hi,
>
> On Tue, 2018-09-25 at 13:22 -0700, JC Beyler wrote:
> > I did say I was not a GC expert :-)
> >
> > So the question would be: is the patch I showed based on Nijiaben's
> > patch worth fixing and is it right? It seems like the right thing to
> > do for at least fixing SerialGC printouts, no?
>
> Yes. Serial GC is fully supported.
>
> I am not sure what release this is reported for, probably 8. Not sure
> if it is worth backporting (then again, on 8u both CMS and Serial are
> supported).
>
> > Ps: here is the patch for simplifying things for everyone then:
> > diff -r 8f66a57054b7 src/hotspot/share/gc/shared/genCollectedHeap.cpp
> > --- a/src/hotspot/share/gc/shared/genCollectedHeap.cpp  Tue Sep 25
> > 10:30:32 2018 -0700
> > +++ b/src/hotspot/share/gc/shared/genCollectedHeap.cpp  Tue Sep 25
> > 12:50:54 2018 -0700
> > @@ -649,7 +649,6 @@
> >      complete = complete || collected_old;
> >
> >      print_heap_change(young_prev_used, old_prev_used);
> > -    MetaspaceUtils::print_metaspace_change(metadata_prev_used);
> >
> >      // Adjust generation sizes.
> >      if (collected_old) {
> > @@ -665,6 +664,7 @@
> >        MetaspaceGC::compute_new_size();
> >        update_full_collections_completed();
> >      }
> > +    MetaspaceUtils::print_metaspace_change(metadata_prev_used);
> >
> >      // Track memory usage and detect low memory after GC finishes
> >      MemoryService::track_memory_usage();
> >
>
> Looks good. Would it be possible to write a small junit test that
> checks that metaspace usage decreased after full gc?
>
> That should be true for all collectors assuming they do not have class
> unloading disabled.
>
> Thanks,
>   Thomas
>
>

-- 

Thanks,
Jc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/attachments/20180926/38222213/attachment.html>


More information about the hotspot-gc-dev mailing list