RFR: 8025313: MetaspaceMemoryPool incorrectly reports undefined size for max
Jon Masamitsu
jon.masamitsu at oracle.com
Wed Oct 2 20:03:53 UTC 2013
On 9/30/2013 8:20 AM, 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.
I like knowing that a flag has been set by the VM so suggest leaving the
FLAG_SET_ERGO
and changing
size_t MetaspacePool::calculate_max_size():
return FLAG_IS_CMDLINE(MaxMetaspaceSize) ?
MaxMetaspaceSize : MemoryUsage::undefined_size();
to
return !FLAG_IS_DEFAULT(MaxMetaspaceSize) ?
MaxMetaspaceSize : MemoryUsage::undefined_size();
>
> Webrev:
> http://cr.openjdk.java.net/~ehelin/8025313/webrev.00/
>
> Bug:
> https://bugs.openjdk.java.net/browse/JDK-8025313
>
> Thanks,
> Erik
More information about the hotspot-gc-dev
mailing list