Configuring HBase Garbage Collection
To tune the garbage collection settings, you pass the relevant parameters to the JVM.
Example configuration values are not recommendations and should not be considered as such. This is not the complete list of configuration options related to garbage collection. See the documentation for your JVM for details on these settings.
- -XX:+UseG1GC
- Use the 'G1' garbage collection algorithm. You can tune G1 garbage collection to provide a consistent pause time, which benefits long-term running Java processes such as HBase, NameNode, Solr, and ZooKeeper. For more information about tuning G1, see the Oracle documentation on tuning garbage collection.
- -XX:MaxGCPauseMillis=value
- The garbage collection pause time. Set this to the maximum amount of latency your cluster can tolerate while allowing as much garbage collection as possible.
- -XX:+ParallelRefProcEnabled
- Enable or disable parallel reference processing by using a + or - symbol before the parameter name.
- -XX:-ResizePLAB
- Enable or disable resizing of Promotion Local Allocation Buffers (PLABs) by using a + or - symbol before the parameter name.
- -XX:ParallelGCThreads=value
- The number of parallel garbage collection threads to run concurrently.
- -XX:G1NewSizePercent=value
- The percent of the heap to be used for garbage collection. If the value is too low, garbage collection is ineffective. If the value is too high, not enough heap is available for other uses by HBase.
If your cluster is managed by Cloudera Manager, follow the instructions in Configure HBase Garbage Collection Using Cloudera Manager. Otherwise, use Configure HBase Garbage Collection Using the Command Line.
Configure HBase Garbage Collection Using Cloudera Manager
Minimum Required Role: Full Administrator
- Go to the HBase service.
- Click the Configuration tab.
- Select .
- Select .
- Locate the Java Configuration Options for HBase RegionServer property or search for it by typing its name in the Search box.
- Add or modify JVM configuration options.
- Click Save Changes to commit the changes.
- Restart the role.
Configure HBase Garbage Collection Using the Command Line
- On each RegionServer, edit conf/hbase-env.sh.
- Add or modify JVM configuration options on the line beginning with HBASE_OPTS.
- Restart the RegionServer.
Disabling the BoundedByteBufferPool
HBase uses a BoundedByteBufferPool to avoid fragmenting the heap. The G1 garbage collector reduces the need to avoid fragmenting the heap in some cases. If you use the G1 garbage collector, you can disable the BoundedByteBufferPool in HBase in CDH 5.7 and higher. This can reduce the number of "old generation" items that need to be collected. This configuration is experimental.
To disable the BoundedByteBufferPool, set the hbase.ipc.server.reservoir.enabled property to false.
Disable the BoundedByteBufferPool Using Cloudera Manager
- Go to the HBase service.
- Click the Configuration tab.
- Select .
- Select .
- Locate the HBase Service Advanced Configuration Snippet (Safety Valve) for hbase-site.xml property, or search for it by typing its name in the Search box.
- Add the following XML:
<property> <name>hbase.ipc.server.reservoir.enabled</name> <value>false</value> </property>
- Click Save Changes to commit the changes.
- Restart the service.
Disable the BoundedByteBufferPool Using the Command Line
- On each RegionServer, edit conf/hbase-site.xml.
- Add the following XML:
<property> <name>hbase.ipc.server.reservoir.enabled</name> <value>false</value> </property>
- Save your changes.
- Restart the RegionServer.