Bottom Line Tuning Tips for G1GC
When I read HBase User Maillist. I come cross Bryan Beaudreault’s experiences[1] about When they using G1 garage colllector with HBase in Hubspot. I want to note those. You can see below:
- If an allocation is larger than a 50% of the G1 region size, it is a humongous allocation which is more expensive to clean up. You should want to avoid this.
- The default region size is only a few mb, so any big batch puts or scans can easily be considered humongous. If you don't set Xms, it will be even smaller.
- Make sure you are setting Xms to the same value as Xmx. This is used by the G1 to calculate default region sizes.
- Enable -XX:+PrintAdaptiveSizePolicy, which will print out information you can use for debugging humongous allocations. Any time an allocation is considered humongous, it will print the size of the allocation.
- Using the output of the above, determine your optimal region size. Region sizes must be a power of 2, and you should generally target around 2000 regions. So a compromise is sometimes needed, as you don't want to be *too* far below this number.
- Use -XX:G1HeapRegionSize=xM to set the region size. Use a power of 2.
[1] http://apache-hbase.679495.n3.nabble.com/How-to-know-the-root-reason-to-cause-RegionServer-OOM-tp4071357p4071402.html