Setting Custom Memory Settings for the Admin Server

Memory settings for the Admin Server can be modified by editing the $MW_HOME\user_projects\domains\\bin\startWebLogic startup script. Add the MEM_ARGS parameter to override the setDomainEnv USER_MEM_ARGS value here:
MEM_ARGS="-Xms<value>m -Xmx<value>m"
export MEM_ARGS

Setting Custom Memory Settings for the Managed Server

There are four options available to set memory arguments for Managed Server instance. To edit memory values, implement one of the following:
  1. When starting a managed server through the $MW_HOME\user_projects\domains\\bin\StartManagedWebLogic script, you can add the memory arguments desired.
    1. First set the domain environment by calling setDomainEnv.
    2. Call StartManagedWebLogic <ManagedServerName> <AdminURL> -Xms<value>m -Xmx<value>m
      where <ManagedServerName> is your managed server to be started.
      is the Adminstration Server address, e.g., http://localhost:7001
      <value> is the desired heap size ie: -Xms256m -Xmx256m to get a fixed heap size
    3. You still will see something like this in the output:
      JAVA Memory arguments: -Xms512m -Xmx512m
      but that is overridden by the given arguments.
  2. Create a custom Start Managed Weblogic script. Make a copy of StartManagedWebLogic and edit the following:
    1. After the JAVA_OPTIONS = "... {JAVA_OPTIONS}" line type:
      JAVA_OPTIONS="${JAVA_OPTIONS} -Xms<value>m -Xmx<value>m"
    2. You still will see something like this in the output:
      JAVA Memory arguments: -Xms512m -Xmx512m
      but that is overridden by the given arguments.
    3. Check the Note remark below when creating a script.
  3. Sending the Startup Memory Arguments when you have NodeManager configured. When you have your Managed Server instances configured to be controlled by Node Manager, the memory arguments can be passed as startup parameters from the Admin Console.
    1. From the Admin Console, select the server instance you want to start: -> Configuration -> Server Start -> Arguments
    2. In the 'Server Start' page for the managed server in the admin console, add the memory values-Xms<value>m -Xmx<value>munder the arguments tab.
  4. Modify the $MW_HOME\user_projects\domains\<domain_name>\config\config.xml file. Add the <server-start> tags and inside add <arguments> as in the following example:
    <server>
      <name>ServerA</name>
      ...
      <server-start>
        <arguments>-Xms128m -Xmx128m</arguments>
      </server-start>
      ...
    </server>
    Verify the configured memory values in the Admin Console by navigating to Servers -> <ManagedServerName> -> Monitoring -> Performance. On this page, you will see Heap Size Current for the current heap size. This value is listed in bytes.
    NOTE: We do not recommend editing the config.xml file directly as a simple mistake could cause your entire domain to fail to start up correctly. If you do choose this method, make sure you have a backup copy of the config.xml file available in case of problems.
    Also these same methods also apply to other Java options, for instance, debug flags.

Verifying the Heap Memory Settings

We can use the WebLogic Administration Console.
Having the Admin Server Up and Running, access the console.
Click on Environment, Servers and for each server, on the Monitoring -> Performance tab.
There you will see all of the Heap information, Current Size, Current free, Free Percent and Maximum Heap Size. (These values are in Bytes, so to get the estimated set value of the memory arguments, divide it by 1024 )

Note on creating your own script for starting a managed server
This was recently tested on WLS 10.3.6. If you copy the StartManagedWeblogic.sh script, you'll note that the ADMIN_URL is set.
You'll need to be very careful and check which protocol and IP the Admin Server is actually listening. Key aspects are ://:

2 Comments

  1. we can use command ps in unix Linux
    example:
    ps -ef | grep Xms

    ReplyDelete
  2. we can use unix or Linux ps command too
    example
    ps -ef | grep Xms

    ReplyDelete