3

I launched jvm with JAVA_OPTS like this:

JAVA_OPTS="-server -Xms1500m -Xmx1500m -Xmn455m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=1024m"

After a time, when I look over GC log:

[Full GC (Ergonomics) [PSYoungGen: 352K->0K(460288K)] [ParOldGen: 1069272K->352585K(1070080K)] 1069624K->352585K(1530368K), [Metaspace: 333651K->333631K(1808384K)], 0.5450331 secs] [Times: user=1.46 sys=0.00, real=0.54 secs]

I'm confused.I have already set MaxMetaspaceSize=1024m, but according to log, there are 1808384K(about 1.7G) actually, why?

Juey
  • 123
  • 1
  • 6
  • The metaspace used is 333 MB but the maximum is 1800 MB which doesn't appear to make sense unless the option isn't being used although your `-Xmn` and `-Xmx` does appear to be about right. – Peter Lawrey Feb 11 '18 at 22:28

1 Answers1

4

MaxMetaspaceSize limits the amount of committed metaspace memory, while the GC log prints the amount of reserved virtual memory. Reserved address space does not necessarily occupy any physical memory or swap space.

More about Metaspace structure »

apangin
  • 92,924
  • 10
  • 193
  • 247