VisualVM shows double Xmx as Max Heap Size
Asked Answered
K

1

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?

Kinsler answered 9/11, 2015 at 13:50 Comment(6)
70000 MB = 70 GB. Can you confirm that you are asking for that large a heap? This doesn't look correct to me.Undervalue
My mistake - thanks for the correction.Undervalue
Yes it is really that big!Kinsler
BTW. We have a Server with 192 GB RAM, running three jvms (one with 30GB and two with 70GB)Kinsler
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.Undervalue
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.Kinsler
W
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.

Whitherward answered 22/11, 2016 at 14:23 Comment(1)
here is the github bug report: github.com/oracle/visualvm/issues/127Lothians

© 2022 - 2024 — McMap. All rights reserved.