Out of memory issue with weblogic server 11g

Sam picture Sam · Oct 22, 2012 · Viewed 17.7k times · Source

I am using weblogic 10.3.6 with JRockit installed . I am using a 64 bit system with Linux as OS. I have an adf application installed in it . There are only a couple of users using the application . But the server machine where WLS is installed keeps going down every week causing out of memory . so we have to restart it every week. When i was looking through I found that WebLogic can be made more stable by adjusting the heap size and other memory arguments .

Example: --Xms256m --Xmx512m MaxPermsize as 128m

My question is

  1. What are these arguments ?

  2. How are these arguments related to one another?

  3. How do I determine the value for these arguments?

  4. What can be other causes for out of memory issue?

Thanks,

Rakesh

Answer

Mani picture Mani · Oct 23, 2012

Xms and Xmx are the minimum and the maximum heap (essentially where the objects are stored) size the java program can use.

In your case the java program is the WebLogic server on which your application is deployed. By default the Xms and Xmx values set by WebLogic server are : 256m and 512m.

Looks like your application needs more than 512MB heap memory. So you need to increase the maximum heap size (Xmx) to avoid frequent OutOfMemory error.

The new value of Xmx can be 1024m or more. You (or Performance team, if there is one.) have to do rigorous Performance, Scalability, Reliability testing with your application and with different Xmx values to determine what is the best for the application.

Setting the Memory Arguments (i.e Xms, Xmx) can be done at the script level (if you are using startWebLogic.sh/startManagedWebLogic.sh scripts to start the servers).

Script Level Changes:

  • Open setDomainEnv.sh and search for 'IF USER_MEM_ARGS the environment variable is set' and in the next line insert USER_MEM_ARGS="-Xms256m -Xmx1024m"
  • You can even change this setting from server to server by using SERVER_NAME variable which holds the server that is being started. For example to have this setting only for non-Admin servers, insert [ "${SERVER_NAME}" != "AdminServer" ] && USER_MEM_ARGS="-Xms256m -Xmx1024m"

Console Changes (Only if you use Admin Console to start the managed servers):

  • Login to AdminConsole–>Environments—>Servers—>—>Configuration—>ServerStart—>Arguments:(TextArea).
  • Enter : -Xms256m -Xmx1024m and Save.

Oh, btw JRockit does not have any concept of PermSize.