Sometimes java -Xlog:gc+heap+exit shows "used 0K", which seems misleading since we must have allocated some objects in the Java heap.
$ java -Xlog:gc+heap+exit -Xshare:off -Xmx16g -version
[0.072s][info][gc,heap,exit] garbage-first heap total 1032192K, used 0K [0x00000003c0000000, 0x00000007c0000000)
[0.072s][info][gc,heap,exit] region size 8192K, 1 young (8192K), 0 survivors (0K)
$ java -Xlog:gc+heap+exit -Xshare:off -Xmx4g -version
[0.072s][info][gc,heap,exit] garbage-first heap total 1030144K, used 2048K [0x00000006c0000000, 0x00000007c0000000)
[0.072s][info][gc,heap,exit] region size 2048K, 2 young (4096K), 0 survivors (0K)
$ java -Xlog:gc+heap+exit -Xshare:off -Xmx16g -version
[0.072s][info][gc,heap,exit] garbage-first heap total 1032192K, used 0K [0x00000003c0000000, 0x00000007c0000000)
[0.072s][info][gc,heap,exit] region size 8192K, 1 young (8192K), 0 survivors (0K)
$ java -Xlog:gc+heap+exit -Xshare:off -Xmx4g -version
[0.072s][info][gc,heap,exit] garbage-first heap total 1030144K, used 2048K [0x00000006c0000000, 0x00000007c0000000)
[0.072s][info][gc,heap,exit] region size 2048K, 2 young (4096K), 0 survivors (0K)