explain high virtual memory claimed by Java process

Tao Mao yiyeguhu at gmail.com
Wed Aug 8 02:40:45 UTC 2018


Hi gc exports,

I have a Java  application with following JVM options:
"-Xms128m -Xmx256m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m"

When I use top to check memory usage, I got a very high virtual memory but
a reasonable resident memory as below:

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
93704 root 20 0 *11.4g* *477m* 19m S 0.0 0.1 26:53.65 java

I understand the claimed virtual memory can be more than heapsize +
metaspaceSize due to overheads in JVM implementation. I would expect this
number to be a couple times of the size (heapsize + metaspaceSize) at most.
But in this case it's >20 times.

The claimed virtual memory usually is comprised of heap size, metaspace
Size, and stack space. Could someone explain what else can contribute to
this high markup? Thanks.

# java -version
java version "1.8.0_172"
Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)

Regards,
Tao Mao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-gc-use/attachments/20180807/95f54db9/attachment.html>


More information about the hotspot-gc-use mailing list