Customizing JVM Memory Settings for WebLogic

When using the default configuration in a WebLogic domain, there is only one JVM memory setting used for every server. This can be very inefficient and problematic. When using Node Manager to control the servers, Custom Memory settings can be configured through the WebLogic Console. However, if the domain isn’t configured to use Node Manager the startWebLogic.sh script is the best location to add these settings. Even when using Node Manager, a best practice is to add custom settings to the startWebLogic.sh script

Edit startWebLogic.sh located in the [domain]/bin directory

 vi startWebLogic.sh  

Add a Case statement about the middle of the script with something similar to the following example:

 case "${SERVER_NAME}" in  
 'AdminServer')  
                 MEM_ARGS="-Xms1536m -Xmx1536m"  
                 export MEM_ARGS  
         ;;  
 'WLS_WSM1')  
                 MEM_ARGS="-Xms512m -Xmx512m"  
                 export MEM_ARGS  
         ;;  
 'WLS_SOA1')  
                 MEM_ARGS="-Xms2048m -Xmx2048m"  
                 export MEM_ARGS  
         ;;  
 'WLS_OSB1')  
                 MEM_ARGS="-Xms1024m -Xmx1024m"  
                 export MEM_ARGS  
         ;;  
 'WLS_ESS1')  
                 MEM_ARGS="-Xms1024m -Xmx1024m"  
                 export MEM_ARGS  
         ;;  
 'WLS_BAM1')  
                 MEM_ARGS="-Xms1024m -Xmx1024m"  
                 export MEM_ARGS  
         ;;  
 esac  

After making the change, the java start up parameters will read the new MEM_ARGS setting dependent upon which server value is being passed. Additional arguments can be added using the same Case statement for further customization

NOTE: Server Names must match the names configured in the domain. Server Names are case sensitive