WebLogic Server: Setting Custom Memory Values (Heap Size)
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\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:- When starting a managed server through the $MW_HOME\user_projects\domains\
\bin\StartManagedWebLogic script, you can add the memory arguments desired. - First set the domain environment by calling setDomainEnv.
- 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 - You still will see something like this in the output:
JAVA Memory arguments: -Xms512m -Xmx512mbut that is overridden by the given arguments.
- Create a custom Start Managed Weblogic script. Make a copy of StartManagedWebLogic and edit the following:
- After the JAVA_OPTIONS = "... {JAVA_OPTIONS}" line type:
JAVA_OPTIONS="${JAVA_OPTIONS} -Xms<value>m -Xmx<value>m" - You still will see something like this in the output:
JAVA Memory arguments: -Xms512m -Xmx512mbut that is overridden by the given arguments. - Check the Note remark below when creating a script.
- After the JAVA_OPTIONS = "... {JAVA_OPTIONS}" line type:
- 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.
- From the Admin Console, select the server instance you want to start:
-> Configuration -> Server Start -> Arguments - 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.
- From the Admin Console, select the server instance you want to start:
- 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>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.
<name>ServerA</name>
...
<server-start>
<arguments>-Xms128m -Xmx128m</arguments>
</server-start>
...
</server>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
we can use command ps in unix Linux
ReplyDeleteexample:
ps -ef | grep Xms
we can use unix or Linux ps command too
ReplyDeleteexample
ps -ef | grep Xms