It is commonly known that it is possible to limit the Java heap size with -Xmx<amount><unit>
, where unit
is the data amount unit like Gigabyte, Megabyte, etc.
I know that -Xmx128M
means 128 Mebibytes (= 128 * 1024 * 1024 bytes).
But is it true, that it is also possible to use decimal units like megabytes using -Xmx100m
(which would be 100 * 1000 * 1000 bytes)?
So is it possible to use this decimal units by using lower-case unit suffixes like k, m, g
instead of K, M, G
?
System.out.println(Runtime.getRuntime().maxMemory());
with-Xmx1g
prints954728448
– Highwrought