RFR: 8204170: MXBeanException.java assumes the existence of a pool that doesn't support usage threshold

Stefan Karlsson stefan.karlsson at oracle.com
Thu May 31 16:13:31 UTC 2018


Thanks, Erik.

StefanK

On 2018-05-31 16:27, Erik Österlund wrote:
> Hi Stefan,
>
> Looks good.
>
> Thanks,
> /Erik
>
> On 2018-05-31 15:38, Stefan Karlsson wrote:
>> Hi all,
>>
>> Please review this patch to deal with the case when all available 
>> MemoryPoolMXBeans support usage thresholds.
>>
>> http://cr.openjdk.java.net/~stefank/8204170/webrev.01/
>> https://bugs.openjdk.java.net/browse/JDK-8204170
>>
>> The tests searches for a MemoryPoolMXBean that returns false for 
>> isUsageThresholdSupported(), and then uses one of those pools to 
>> trigger UnsupportedOperationExceptions when setUsageThreshold is used.
>>
>> ZGC doesn't provide a pool that doesn't support usage threshold, and 
>> the test therefore throws an NPE.
>>
>> The suggested fix is to add:
>>         if (pool == null) {
>>           return; // All pools support usage threshold
>>         }
>>
>> An alternative fix would be to filter out the test if ZGC is used.
>>
>> Thanks,
>> StefanK
>



More information about the serviceability-dev mailing list