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

to create new topics or reply. | New User Registration

Tagged: 

This topic contains 4 replies, has 2 voices, and was last updated by  David Nguyen 1 year, 10 months ago.

  • Creator
    Topic
  • #39083

    David Nguyen
    Member

    I have installed HDP via rpms on Centos6.4

    hbase-0.94.6.1.3.2.0-111.el5.noarch

    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
    JAVA_HEAP_MAX=-Xmx1000m

    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 “$@”
    else
    exec “$JAVA” -XX:OnOutOfMemoryError=”kill -9 %p” $JAVA_HEAP_MAX $HBASE_OPTS -classpath “$CLASSPATH” $CLASS “$@”
    fi

    So regardless of what is being set in hbase-env.sh, $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-$COMMAND.sh and overload JAVA_HEAP_MAX if we want to use a different heap size than 1000m?

    David

Viewing 4 replies - 1 through 4 (of 4 total)

You must be to reply to this topic. | Create Account

  • Author
    Replies
  • #39376

    David Nguyen
    Member

    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!

    David

    Collapse
    #39365

    abdelrahman
    Moderator

    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.

    Thanks
    -Rahman

    Collapse
    #39364

    David Nguyen
    Member

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

    Thanks for the reply. Yeah I have those set in hbase-env.sh 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 hbase-env.sh (which gets pulled in as $HBASE_OPTS), $JAVA_HEAP_MAX is prepended to the options.

    David

    Collapse
    #39357

    abdelrahman
    Moderator

    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 hbase-env.sh 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”
    #

    Thanks
    -Rahman

    Collapse
Viewing 4 replies - 1 through 4 (of 4 total)
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.