Tuesday 20 December 2011

How to increase heap size in Weblogic

What is JAVA heap size ? 


Java heap is the heap size allocated to JVM applications which takes care of the new objects   
being created. If the objects being created exceed the heap size, it will throw an error saying memoryOutof Bound Java's default heap size limit is 128MB. 
If you need more than this, you should use the -Xms and -Xmx command line arguments when launching your program: 
java -Xms -Xmx
We can also give like in this format also.format is : -mx256m..Sometimes it will show error if you are using
java -Xms -Xmx format..In that case use -mx256m this.value can be changed..



In this post, I will show you how to increase the Heap size in Weblogic.

There are two ways to increase the heap size in weblogic.

If you are using the nodemanager then 

Login to the weblogic Administration console, then click on 

Servers --- ServerName --- General --- Remote Start Options and look for the Java Arguments 

Here you can add -512Xmx -512Xms to the java arguments. 
If you want to increase the heap size then alter these values from 512 to 1024 depending on your requirements.

If you do not have a nodemanager configured then follow the below mention steps.

Login the operating system , Under $domain_home/bin directory look for setDomainEnv.sh and add the following -512Xmx -512Xms to the java options.

There  are 2 different type of servers in Weblogic Server

1. Admin Server
2. Managed Server


Increasing JVM Size of Admin Server

JVM size of Admin server can be increased by changing Xmx and Xms  values in setDomainEnv.sh which is located in $MW_HOME/user_projects/domains/<Domain>/bin

There are two blocks for XMX and XMS in setDomainEnv.sh. Depending up on type of JVM make changes in second block. Below I changed the value of XMX and XMS of 64 Bit SUN Java to 2048 and 1024.

XMS_SUN_64BIT=”256?
export XMS_SUN_64BIT
XMS_SUN_32BIT=”256?
export XMS_SUN_32BIT
XMX_SUN_64BIT=”512?
export XMX_SUN_64BIT
XMX_SUN_32BIT=”512?
export XMX_SUN_32BIT

XMS_JROCKIT_64BIT=”256?
export XMS_JROCKIT_64BIT
XMS_JROCKIT_32BIT=”256?
export XMS_JROCKIT_32BIT
XMX_JROCKIT_64BIT=”512?
export XMX_JROCKIT_64BIT
XMX_JROCKIT_32BIT=”512?
export XMX_JROCKIT_32BIT

XMS_SUN_64BIT=”1024?
export XMS_SUN_64BIT
XMS_SUN_32BIT=”512?
export XMS_SUN_32BIT
XMX_SUN_64BIT=”2048?
export XMX_SUN_64BIT
XMX_SUN_32BIT=”1024?
export XMX_SUN_32BIT

XMS_JROCKIT_64BIT=”512?
export XMS_JROCKIT_64BIT
XMS_JROCKIT_32BIT=”512?
export XMS_JROCKIT_32BIT
XMX_JROCKIT_64BIT=”1024?
export XMX_JROCKIT_64BIT
XMX_JROCKIT_32BIT=”1024?
export XMX_JROCKIT_32BIT

Increasing JVM Size of Managed Server
JVM size of Managed Server  can  be increased from Weblogic console. This can be achieved  by adding 

Xmx and Xms values   start tab in Managed server shown as below

Servers 
Server-Name
Server Start
check the Arguments
























These changes will require a restart of the server.

If you have any query regarding this post, feel free to ask.



No comments:

Post a Comment