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
Thu Sep 27 12:09:13 UTC 2018


Hi JC,

On Wed, 2018-09-26 at 19:21 -0700, JC Beyler wrote:
> 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

I do not know a better way than having an external jar to do class
loading into a separate class loader in a test. It's safest to
duplicate the jar file.

The test could be simplified a bit by using the Metaspace MemoryMXBean
to get metaspace memory readings (there is an MXBean called
"Metaspace"), removing the need for invoking a secondary JVM in the
test and parsing the log :)

You can then run the test with the different collectors using
"main/othervm -XX:+<some-gc> MyTest" lines.

Otherwise the change itself looks good. I would appreciate if the test
could be improved as mentioned above, but if you do not want to I could
live with it as is.

Btw, you can have multiple contributors in that line (or probably
multiple Contributed-by lines).

Thanks,
  Thomas




More information about the hotspot-gc-dev mailing list