RFR: 8025313: MetaspaceMemoryPool incorrectly reports undefined size for max

Erik Helin erik.helin at oracle.com
Tue Oct 1 11:23:53 UTC 2013


On 2013-10-01, Stefan Karlsson wrote:
> On 10/01/2013 12:13 PM, Erik Helin wrote:
> >Hi Stefan,
> >
> >I've uploaded a new webrev with your suggested changes at:
> >http://cr.openjdk.java.net/~ehelin/8025313/webrev.01/
> 
> Thanks for doing the changes. Could you leave the newlines that you
> removed from lines 71 and 75?

Sure, I'll fix that before I push. Thanks for reviewing!

Erik

> thanks,
> StefanK
> 
> >
> >This version also includes a comment based on a discussion with Thomas.
> >
> >Thanks,
> >Erik
> >
> >On 2013-09-30, Stefan Karlsson wrote:
> >>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
> 



More information about the hotspot-gc-dev mailing list