Wednesday, October 25, 2017

Customizing the WebLogic JVM heap size

How to customize Java Virtual Machine Settings in Oracle WebLogic Server

To achieve the best performance of the application and avoid performance bottlenecks problems ( “OutOfMemory”) you need to tune your Java Virtual Machine.
After fresh install of WebLogic Server and create a Domain (WebLogic or SOA or Forms or OBIEE etc.) you may set some properties such as Java “Heap size”, tune Java “Garbage Collection” and WebLogic Server start options.
Tune JVM settings
set the Variable USER_MEM_ARGS for the Admin Server and each Managed Server to tune the JVM Parameters. For Example:
USER_MEM_ARGS="-Xms1g -Xmx3g -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:NewSize=1g"


Where:
  • Xms1g: JVM initial heap size: In this example: 1 GB
  • Xmx3g: JVM maximal heap size: The heap can grow to 3 GB
  • -XX:+UseParNewGC: Uses parallel version of a younger generation

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.
To change the WebLogic JVM heap size:
  1. Open the setDomainEnv file in a text editor.
  2. Search for this comment line:
    For Linux:
    # IF USER_MEM_ARGS the environment variable is set, use it to override ALL MEM_ARGS values
    For Windows:
    @REM IF USER_MEM_ARGS the environment variable is set, use it to override ALL MEM_ARGS values
  3. Immediately after the comment line, add one of these lines:
    For Linux:
    export USER_MEM_ARGS="-Xms128m -Xmx3072m ${MEM_DEV_ARGS} ${MEM_MAX_PERM_SIZE}"
    For Windows:
    set USER_MEM_ARGS=-Xms128m -Xmx3072m %MEM_DEV_ARGS% %MEM_MAX_PERM_SIZE%
  4. Save the file.
  5. Re-start WebLogic Server.      

0 comments :

Post a Comment

Note: Only a member of this blog may post a comment.