• Find us:
    +1-669-900-5138   |   +44-203-372-5553
  • Free Newsletter

    Get Latest Updates

  • Make Training Enquiry


    Company

  • Categories

  • Archive

  • Customizing Heap Size in a Weblogic domain

    Posted by "" in "How To ?, weblogic" on 2013-03-16

    Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInEmail this to someone

    We often come across cases where we require to modify the heap size according to our applications’s needs eg java.lang.OutOfMemoryError
    Whenever we want to change the Heap size in WebLogic server (AdminServer or managed servers), we can customize setDomainEnv.sh in $DOMAIN_HOME/bin with required memory arguments.
    Below are the two scenarios:

    Scenario 1:
    We need to change the memory arguments to a value same for all servers in a Domain. Suppose we want to keep Xmx 1024 M and Xms 1024 M for all server in an Domain (Admin and all managed servers).
    We will edit setDomainEnv.sh in $DOMAIN_HOME/bin with our required values of Xmx and Xms.
    Search for line “# IF USER_MEM_ARGS the environment variable” in setDomainEnv.sh
    We will add line
    USER_MEM_ARGS=”-Xms1024m -Xmx1024m”
    export USER_MEM_ARGS
    below line “ # IF USER_MEM_ARGS the environment variable is set, use it to override ALL MEM_ARGS values”
    and above line “ if [ “${USER_MEM_ARGS}” != “” ] ; then”
    Example :
    # IF USER_MEM_ARGS the environment variable is set, use it to override ALL MEM_ARGS values
    USER_MEM_ARGS=”-Xms1024m -Xmx1024m”
    export USER_MEM_ARGS
    if [ “${USER_MEM_ARGS}” != “” ] ; then
    MEM_ARGS=”${USER_MEM_ARGS}”
    export MEM_ARGS
    fi

    Scenario 2:
    We need to change the memory arguments to values different for all servers in a Domain. Suppose we want to keep Xmx 512 M and Xms 512 M for Admin server and Xmx 1g and Xms 1g for ebsag_server and oam_server1 managed servers in a Domain
    We will edit setDomainEnv.sh in $DOMAIN_HOME/bin with our required values of Xmx and Xms.
    Search for line “# IF USER_MEM_ARGS the environment variable” in setDomainEnv.sh
    We will add lines
    case “${SERVER_NAME}” in
    “AdminServer”) USER_MEM_ARGS=”-Xms512m -Xmx512m” ;;
    “oam_server1″) USER_MEM_ARGS=”-Xms1g -Xmx1g” ;;
    “ebsag_server”) USER_MEM_ARGS=”-Xms1g -Xmx1g” ;; *)
    echo “Unknown Server Detected!!. Memory set as Xms1g Xmx2g.”;
    USER_MEM_ARGS=”-Xms1g -Xmx2g” ;;
    esac
    USER_MEM_ARGS=”${USER_MEM_ARGS} -d64 -XX:PermSize=256m -XX:MaxPermSize=512m -Djava.awtheadless=true -Djbo.ampool.maxpoolsize=600000″
    Below line “ # IF USER_MEM_ARGS the environment variable is set, use it to override ALL MEM_ARGS values” and above line “ if [ “${USER_MEM_ARGS}” != “” ] ; then”

    Note that we are using Switch case programming concept in defining different memory arguments for different servers in this domain. We can edit this switch case as per our requirements.
    Example :
    # IF USER_MEM_ARGS the environment variable is set, use it to override ALL MEM_ARGS values

    case “${SERVER_NAME}” in
    “AdminServer”) USER_MEM_ARGS=”-Xms512m -Xmx512m” ;;
    “oam_server1″) USER_MEM_ARGS=”-Xms1g -Xmx1g” ;;
    “ebsag_server”) USER_MEM_ARGS=”-Xms1g -Xmx1g” ;; *)
    echo “Unknown Server Detected!!. Memory set as Xms1g Xmx2g.”;
    USER_MEM_ARGS=”-Xms1g -Xmx2g” ;;
    esac
    USER_MEM_ARGS=”${USER_MEM_ARGS} -d64 -XX:PermSize=256m -XX:MaxPermSize=512m -Djava.awtheadless=true -Djbo.ampool.maxpoolsize=600000″

    if [ “${USER_MEM_ARGS}” != “” ] ; then
    MEM_ARGS=”${USER_MEM_ARGS}”
    export MEM_ARGS
    fi

    This change will be reflected when the Servers are bounced . The new heap size change can be confirmed from the Admin console of the domain (Click on servers -> server_name -> monitoring -> performance) or from server_name.log or server_name.out in $DOMAIN_HOME/servers/Server_Name/logs.

    Leave a Reply



  • K21 Technologies is among the most experienced Oracle Gold Partner for Identity Access Management service providers. We work with application development companies and in-house technology division to help achieve significant returns on their IT security investment. Our clientele includes some of the globally renowned corporate, which speaks of our expertise in our field.

    We have the most talented and experienced team that can swiftly deploy security solutions even in complex IT ecosystem. Our clients highly appreciate our timely implementation, interactive training, on-demand support and community resources.
  • CONTACTS

    K21 Technologies
    8 Magnolia Place, Harrow,
    London, HA2 6DS

    UK: +44(0)7476444481
    USA: +1-888-414-1821

  • 2014, K21 Technologies. All rights reserved DMCA.com
  • TOP