RFR: 8154096: Extend WhiteBox API with methods which retrieve from VM information about available GC

Kirill Zhaldybin kirill.zhaldybin at oracle.com
Fri Apr 22 14:56:47 UTC 2016


Dmitry,

On 22.04.2016 17:39, Dmitry Fazunenko wrote:
> Hi Kirill,
>
> thanks for looking at the code.
>
> On 22.04.2016 17:24, Kirill Zhaldybin wrote:
>> Dmitry,
>>
>> http://cr.openjdk.java.net/~dfazunen/8154096/webrev.00/test/test/lib/sun/hotspot/WhiteBox.java.sdiff.html
>>
>>
>>  157   // GC
>>  158   /**
>>  159    * @returns true if GC was selected by ergonomic
>>  160    */
>>  161   public boolean gcSelectedByErgo() {
>>  162     if (getSupportedGC().size() < 2) {
>>  163       return false; // nothing to choose from
>>  164     } else {
>>  165       return gcSelectedByErgo0();
>>  166     }
>>  167   }
>>
>>
>> If only one GC is supported why it cannot be selected by ergonomics?
>> My understanding that if jvm is started without gc flag gc is selected
>> by ergonomics even if there is only one supported gc.
>
> This API will be needed to set @requires properties. If an XXX gc is
> selected by ergo it means it's not specified explicitly by
> -XX:+UseXXXGC, it means -XX:+UseYYYGC could be given without flag
> conflict. If an XXX is the only one GC it could be treated as if XXX
> selected by flag, and no other collectors are allowed.
Thank you for detailed explanation.
Would you mind to add it as a comment to code?
Otherwise looks good.

Regards, Kirill

>
> Thanks,
> Dima

>
>
>
>>
>> Thank you.
>>
>> Regards, Kirill
>>
>> On 13.04.2016 17:54, Dmitry Fazunenko wrote:
>>> Hello,
>>>
>>> I'm looking for a couple of reviews of the change extending the WhiteBox
>>> API to retrieve information about
>>> supported collectors and how the collector was selected.
>>>
>>> https://bugs.openjdk.java.net/browse/JDK-8154096
>>> http://cr.openjdk.java.net/~dfazunen/8154096/webrev.00/
>>>
>>> This change is required to improve work of the jtreg @requires. Now
>>> jtreg sets vm.gc property
>>> based on the given flags (matching VM options  for -XX:+Use???GC
>>> pattern).  The extended WhitBox API
>>> will allow us to set properties like:
>>>      vm.supportsSerialGC
>>>      vm.supportsParallelGC
>>>      vm.supportsConcMarkSweeGC
>>>      vm.supportsG1GC
>>>
>>> And use in test more reliable expression:
>>>    @requires vm.supportsG1GC
>>> instead of
>>>    @requires vm.gc == null | vm.gc == "G1"
>>>
>>> The following CRs are blocked by this RFE.
>>> JDK-8151283 <https://bugs.openjdk.java.net/browse/JDK-8151283>:
>>> Implement setting jtreg @requires property vm.isG1Supported.
>>> JDK-8153758 <https://bugs.openjdk.java.net/browse/JDK-8153758> :
>>> @requires should use more accurate GC type parsing.
>>>
>>> Tested locally.
>>>
>>> Thanks,
>>> Dima
>>
>




More information about the hotspot-gc-dev mailing list