RFR: 8025313: MetaspaceMemoryPool incorrectly reports undefined size for max

Stefan Karlsson stefan.karlsson at oracle.com
Mon Sep 30 08:32:39 PDT 2013


On 2013-09-30 17:28, Stefan Karlsson wrote:
> On 2013-09-30 17:20, Erik Helin wrote:
>> Hi all,
>>
>> this patch fixes an issue where the metaspace memory pool reports -1 for
>> MemoryPoolMXBean.getUsage().getMax(), even though the user has set
>> MaxMetaspaceSize on the command line.
>>
>> The problem is that we in collectorPolicy.cpp use FLAG_SET_ERGO when
>> aligning MaxMetaspaceSize while at the same time relying on
>> FLAG_IS_CMDLINE in memoryPool.cpp when deciding what to return for
>> MetaspacePool::calculate_max_size.
>>
>> This patch removes FLAG_SET_ERGO and instead simply sets
>> MaxMetaspaceSize.
>>
>> Webrev:
>> http://cr.openjdk.java.net/~ehelin/8025313/webrev.00/
>
> Could you also change the setting of MetaspaceSize, so that both flags 
> are set the same way?
>
> Otherwise, this looks good.

You can also remove the is_size_aligned checks:

   67   if (!is_size_aligned(MaxMetaspaceSize, max_alignment())) {
   68     MaxMetaspaceSize = restricted_align_down(MaxMetaspaceSize, max_alignment());
   69   }
   70
   71   if (MetaspaceSize > MaxMetaspaceSize) {
   72     FLAG_SET_ERGO(uintx, MetaspaceSize, MaxMetaspaceSize);
   73   }
   74
   75   if (!is_size_aligned(MetaspaceSize, min_alignment())) {
   76     FLAG_SET_ERGO(uintx, MetaspaceSize,
   77         restricted_align_down(MetaspaceSize, min_alignment()));
   78   }
   79
   80   assert(MetaspaceSize <= MaxMetaspaceSize, "Must be");
   81
   82   MinMetaspaceExpansion = restricted_align_down(MinMetaspaceExpansion, min_alignment());
   83   MaxMetaspaceExpansion = restricted_align_down(MaxMetaspaceExpansion, min_alignment());


StefanK

>
> thanks,
> StefanK
>
>
>>
>> Bug:
>> https://bugs.openjdk.java.net/browse/JDK-8025313
>>
>> Thanks,
>> Erik
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/attachments/20130930/96503033/attachment-0001.html 


More information about the hotspot-gc-dev mailing list