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
?
There is no difference between k and K both means kibibyte
and so does m/M = mebibyte
& g/G = gibibyte
. you can set 100m
as the value and it will be 100 * 1024 * 1024 bytes
. generally it is advised to use this value in powers of 2.
Hope it helps.
Why don't you just try -Xmx100m
and -Xmx100M
and check if there is any difference.k, m, g
work exactly like K, M, G
- they all mean binary units.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With