RFR: 8025313: MetaspaceMemoryPool incorrectly reports undefined size for max

Thomas Schatzl thomas.schatzl at oracle.com
Mon Sep 30 15:50:08 UTC 2013


On Mon, 2013-09-30 at 17:20 +0200, 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.

Why not check for max_uintx in MetaspacePool::calculate_max_size()? It
seems to me that the actual value is important here for returning it to
the MetaspaceMemoryPool, not where it came from.

I mean, what if the user set a value of max_uintx on the commandline? It
always seems unintuitive to me when the user sets a flag to the default
value on the command line and the result is different than when not
setting anything.

> Webrev:
> http://cr.openjdk.java.net/~ehelin/8025313/webrev.00/


More information about the hotspot-gc-dev mailing list