10

I have the following problem:

There is a Java VM with Xmx Option set to 70000m = 70GB (Yes, it is that big). But if I monitor the before mentioned JVM, Max Heap is shown as 140000m (as seen in the screenshot).

Screenshot

Following a listing of used JVM options:

-XX:+UseG1GC
-Duser.timezone=Europe/Berlin
-Djava.security.egd=file:///dev/urandom
-Dsun.rmi.transport.tcp.handshakeTimeout=180000
-Dsun.rmi.dgc.client.gcInterval=600000
-Dsun.rmi.dgc.server.gcInterval=600000
-verbose:gc
-XX:CICompilerCount=2
-Xrunjdwp:transport=dt_socket,server=y,address=3997,suspend=n
-Xms70000m
-Xmx70000m
-XX:+UnlockExperimentalVMOptions
-XX:G1HeapRegionSize=32
-XX:MaxGCPauseMillis=200
-XX:G1NewSizePercent=2
-XX:G1MaxNewSizePercent=60
-XX:ParallelGCThreads=8
-XX:ConcGCThreads=2
-XX:InitiatingHeapOccupancyPercent=45
-XX:G1MixedGCLiveThresholdPercent=65
-XX:G1HeapWastePercent=10
-XX:G1OldCSetRegionThresholdPercent=10
-XX:G1ReservePercent=10

Has anybody a hint, why VisualVM shows double max heap size?

dRoeder
  • 153
  • 1
  • 8
  • 2
    70000 MB = 70 GB. Can you confirm that you are asking for that large a heap? This doesn't look correct to me. – duffymo Nov 09 '15 at 13:53
  • My mistake - thanks for the correction. – duffymo Nov 09 '15 at 13:55
  • Yes it is really that big! – dRoeder Nov 10 '15 at 14:58
  • BTW. We have a Server with 192 GB RAM, running three jvms (one with 30GB and two with 70GB) – dRoeder Nov 10 '15 at 15:01
  • Now it's clear - the JVM doesn't have enough memory. You more than that for the JVM itself and other objects. Even the 70GB JVM won't be sufficient. – duffymo Nov 10 '15 at 15:19
  • Your anwnser is not clear. I'll asked why visualvm shows max heap size with 140GB, although Xmx is set to 70GB. There are no out of memory errors. In the concrete case (where the screenshot was taken) only 30% of Heap was used. – dRoeder Nov 11 '15 at 12:56

1 Answers1

11

This is a bug in visualVM when using the G1 garbage collector, the max is not actually this large. Jconsole does report it correctly.

The following report provides a possible explanation. The reason here is that the different generations no longer have a fixed size, but instead the max size for each is the size of the full heap (as they can both use as much as needed). I have not been able to find any official bug report for this yet.

Thirler
  • 20,239
  • 14
  • 63
  • 92