Why doesn't anyone use G instead of M?

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

d4rkstr1d3r

New Member
Jul 29, 2019
2
0
0
More of a curiosity than anything else. When assigning java heap size why does everyone always right out 8192M instead of simply writing 8G? Does anyone know why it's such common practice?
 

Nanakisan

New Member
Jul 29, 2019
252
0
0
More of a curiosity than anything else. When assigning java heap size why does everyone always right out 8192M instead of simply writing 8G? Does anyone know why it's such common practice?

to my understanding i don't think java understands G only M.
 

d4rkstr1d3r

New Member
Jul 29, 2019
2
0
0
It does understand it. Oracle's own documentation shows that. I was just curious why almost no one uses it.

http://docs.oracle.com/cd/E13150_01/jrockit_jvm/jrockit/jrdocs/refman/optionX.html

Code:
-Xms
 
The -Xms option sets the initial and minimum Java heap size. The Java heap (the “heap”) is the part of the memory where blocks of memory are allocated to objects and freed during garbage collection.
 
Note:    -Xms does not limit the total amount of memory that the JVM can use.
Operation
 
Format: -Xms<size>[g|G|m|M|k|K]
 
Combine -Xms with a memory value and add a unit.
 
For Example:
 
java -Xms:64m myApp
 
sets the initial and minimum java heap to 64 MB.
 
If you do not add a unit, you will get the exact value you state; for example, 64 will be interpreted as 64 bytes, not 64 megabytes or 64 kilobytes.
 
For best performance, set -Xms to the same size as the maximum heap size, for example:
 
java -Xgcprio:throughput -Xmx:64m -Xms:64m myApp
 

Nessiroj

New Member
Jul 29, 2019
855
0
1
I'm using G instead of M, just easier to explain in tickets (2G or 2048M) if you know what i mean ;)