The Hortonworks Community Connection is now live. A completely rebuilt Q&A forum, Knowledge Base, Code Hub and more, backed by the experts in the industry.

You will be redirected here in 10 seconds. If your are not redirected, click here to visit the new site.

The legacy Hortonworks Forum is now closed. You can view a read-only version of the former site by clicking here. The site will be taken offline on January 31,2016

HBase Forum

/usr/lib/hbase/bin/hbase hardcoded to -Xmx1000m – why?

  • #39083
    David Nguyen

    I have installed HDP via rpms on Centos6.4


    I was looking around to try and figure out where the -Xmx1000m is coming from as I see -Xmx defined twice when I run `ps -ef | grep master`. (output looks like this: /usr/java/default/bin/java -XX:OnOutOfMemoryError=kill -9 %p -Xmx1000m … -Xmx10g) and it turns out this is hardcoded in /usr/lib/hbase/bin/hbase

    line 107

    line 352-356
    # Exec unless HBASE_NOEXEC is set.
    if [ “${HBASE_NOEXEC}” != “” ]; then
    “$JAVA” -XX:OnOutOfMemoryError=”kill -9 %p” $JAVA_HEAP_MAX $HBASE_OPTS -classpath “$CLASSPATH” $CLASS “$@”
    exec “$JAVA” -XX:OnOutOfMemoryError=”kill -9 %p” $JAVA_HEAP_MAX $HBASE_OPTS -classpath “$CLASSPATH” $CLASS “$@”

    So regardless of what is being set in, $JAVA_HEAP_MAX (which is defined at the top of the hbase script) is always getting pre–pended before $HBASE_OPTS. Is this intended? Are we expected to create $HBASE_HOME/conf/hbase-env-$ and overload JAVA_HEAP_MAX if we want to use a different heap size than 1000m?


  • Author
  • #39357

    Hi David,

    the configuration setting has the default value and it can be changed. Here is how to change the Heap size for HBase Master and RegionServer processes? in file change the following parameters:

    export HBASE_MASTER_OPTS=”-Xmx1024m”
    export HBASE_REGIONSERVER_OPTS=”-server -XX:ParallelGCThreads=4 -Xmn{somevalue}m -XX:CMSInitiatingOccupancyFraction=70 -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -Xloggc:/var/log/hbase/gc.log-`date +’%Y%m%d%H%M’` -Xms{somevalue}m -Xmx{somevalue}m -XX:ErrorFile=/var/log/hbase/hs_err_pid%p.log”


    David Nguyen

    export HBASE_MASTER_OPTS=”-Xmx10g -Xms10g -XX:NewRatio=8″

    Thanks for the reply. Yeah I have those set in and I can see that my options are active via ps:

    /usr/java/default/bin/java -XX:OnOutOfMemoryError=kill -9 %p -Xmx1000m -ea -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -Xmx10g -Xms10g -XX:NewRatio=8 -Dhbase.log.dir=/var/log/hadoop/hbase -D …..

    The problem is that /usr/lib/hbase/bin/hbase is hardcoded to start hbase like this:

    “$JAVA” -XX:OnOutOfMemoryError=”kill -9 %p” $JAVA_HEAP_MAX $HBASE_OPTS -classpath “$CLASSPATH” $CLASS “$@”

    So regardless of what I put into (which gets pulled in as $HBASE_OPTS), $JAVA_HEAP_MAX is prepended to the options.



    Hi David,

    Please confirm the HBase heap size process by using jmap -heap option. From command line, please run:

    jmap -F -heap PID | grep -i MaxHeapSize

    PID is the process id.


    David Nguyen

    Good idea to check it with jmap. Looks like I’ve been worrying about nothing

    $ /usr/java/default/bin/jmap -F -heap 37861 | grep -i maxheapsize
    Attaching to process ID 37861, please wait…
    Debugger attached successfully.
    Server compiler detected.
    JVM version is 20.6-b01
    MaxHeapSize = 10737418240 (10240.0MB)

    Thanks for the help!


The forum ‘HBase’ is closed to new topics and replies.

Support from the Experts

A HDP Support Subscription connects you experts with deep experience running Apache Hadoop in production, at-scale on the most demanding workloads.

Enterprise Support »

Become HDP Certified

Real world training designed by the core architects of Hadoop. Scenario-based training courses are available in-classroom or online from anywhere in the world

Training »

Hortonworks Data Platform
The Hortonworks Data Platform is a 100% open source distribution of Apache Hadoop that is truly enterprise grade having been built, tested and hardened with enterprise rigor.
Get started with Sandbox
Hortonworks Sandbox is a self-contained virtual machine with Apache Hadoop pre-configured alongside a set of hands-on, step-by-step Hadoop tutorials.
Modern Data Architecture
Tackle the challenges of big data. Hadoop integrates with existing EDW, RDBMS and MPP systems to deliver lower cost, higher capacity infrastructure.