Configuring HBase Garbage Collection

Garbage collection (memory cleanup) by the JVM can cause HBase clients to experience excessive latency. See Tuning Java Garbage Collection for HBase for a discussion of various garbage collection settings and their impacts on performance.

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.

Configure HBase Garbage Collection Using Cloudera Manager

Minimum Required Role: Full Administrator

  1. Go to the HBase service.
  2. Click the Configuration tab.
  3. Select Scope > RegionServer.
  4. Select Category > Advanced.
  5. Locate the Java Configuration Options for HBase RegionServer property or search for it by typing its name in the Search box.
  6. Add or modify JVM configuration options.
  7. Enter a Reason for change, and then click Save Changes to commit the changes.
  8. Restart the role.

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. 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

  1. Go to the HBase service.
  2. Click the Configuration tab.
  3. Select Scope > RegionServer.
  4. Select Category > Advanced.
  5. 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.
  6. Add the following XML:
    <property>
      <name>hbase.ipc.server.reservoir.enabled</name>
      <value>false</value>
    </property>
  7. Enter a Reason for change, and then click Save Changes to commit the changes.
  8. Restart the service.