Scenario 1:
We need to change the memory arguments to a value same for all servers in a Domain.
You can change the default JVM heap size to fit the needs of your deployment.
The default JVM heap size for WebLogic is 3GB. The size is set in the setDomainEnv.sh file for Linux or setDomainEnv.cmd for Windows, which is in the $DOMAIN_HOME/bin directory. The heap size is set with the -Xmx option.
Suppose we want to keep Xmx 3072 M and Xms 128 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.
To change the WebLogic JVM heap size:
This will set Xms to 128 MB and Xmx to 3072 MB for Admin server as well as Managed servers.
Scenario 2:
We need to change the memory arguments to values different for all servers in a Domain. Suppose we want to keep
Xmx 1024M and Xms 1024M for Admin server
and
Xmx 1g and Xms 4g for WLS_FORMS Managed server
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 below the comment
#Admin Server
if [ "${SERVER_NAME}" == "AdminServer" ] ; then
USER_MEM_ARGS="-Xms1024m -Xmx1024m -XX:MaxPermSize=1024m"
export USER_MEM_ARGS
fi
#WLS_FORMS Managed server
if [ "${SERVER_NAME}" == "wls_forms1" ] ; then
USER_MEM_ARGS="-Xms1024m -Xmx4096m -XX:MaxPermSize=4096m"
export USER_MEM_ARGS
fi
Increasing the Java Heap size for a managed server
If you use Node Manager to start the Managed Servers, you can specify a heap size as a Java argument on the Server Start tab for each Managed Server.
To change the Java Heap size for a managed server:
- If you have not already done so, in the Change Center of the Administration Console, click Lock & Edit .
- In the left pane of the console, expand Environment > Servers.
- In the Servers table, click the name of the server instance you want to configure.
- On the Configuration tab, click Server Start.
- In the Arguments field, specify the Java option to increase the heap size. For example: -Xmx1024m
- Click Save.
- To activate these changes, in the Change Center of the Administration Console, click Activate Changes.
- Restart Managed Servers.
- Possibly restart the server if needed.
For better consistency it is good to update the parameters at both location - console and setDomain file.
OR
Add below entries into setDomain.sh file
Thank You !
No comments:
Post a Comment