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

Thomas Schatzl thomas.schatzl at oracle.com
Wed Sep 26 08:11:00 UTC 2018


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




More information about the hotspot-gc-dev mailing list