title: Why XX:G1HeapRegionSize in G1GC must be power of 2?
body: <p>Oracle documentation <a href="https://docs.oracle.com/javase/9/gctuning/garbage-first-garbage-collector.htm#JSGCT-GUID-98E80C82-24D8-41D4-BC39-B2583F04F1FF" rel="nofollow noreferrer">https://docs.oracle.com/javase/9/gctuning/garbage-first-garbage-collector.htm#JSGCT-GUID-98E80C82-24D8-41D4-BC39-B2583F04F1FF</a> says that XX:G1HeapRegionSize <strong>must</strong> be power of 2 but there is no restriction in setting any value between 1m to 32m.</p>
  <p>Question :</p>
  <p>1.Can anyone explain why XX:G1HeapRegionSize <strong>must</strong> be power of 2 ?</p>
  <p>2.For applications that deals with lots humongous objects, after extensive testing and analysing GC causes, GC throughput , GC pause time etc.,the setting XX:G1HeapRegionSize=10m seems to be appropriate. Is there any problem in setting 10m heap region for -Xmx12g ?</p>