#/bin/sh # Set memory arguments on a per server basis # Script matches first part of server name # Call from setDomainEnv.sh to customize memory per server # Add call immediately before the following lines # if [ "${USER_MEM_ARGS}" != "" ] ; then # MEM_ARGS="${USER_MEM_ARGS}" # export MEM_ARGS # fi # The following needs to be customized # DEFAULT value used if no value specified # Blank values use DEFAULT setting # If using JRockit then set *_MINPERM # and *_MAXPERM to empty DEFAULT_MINHEAP=512m DEFAULT_MAXHEAP=1024m DEFAULT_MINPERM=256m DEFAULT_MAXPERM=512m # Prefix 1 SRV1_PREFIX=Admin SRV1_MINHEAP=768m SRV1_MAXHEAP=1280m SRV1_MINPERM= SRV1_MAXPERM= # Prefix 2 SRV2_PREFIX=osb SRV2_MINHEAP=768m SRV2_MAXHEAP=1280m SRV2_MINPERM= SRV2_MAXPERM= # Prefix 3 SRV3_PREFIX=soa SRV3_MINHEAP=1024m SRV3_MAXHEAP=1536m SRV3_MINPERM= SRV3_MAXPERM= # Prefix 4 SRV4_PREFIX=bam SRV4_MINHEAP=768m SRV4_MAXHEAP=2048m SRV4_MINPERM= SRV4_MAXPERM= # Prefix 5 SRV5_PREFIX=wsm SRV5_MINHEAP=256m SRV5_MAXHEAP=384m SRV5_MINPERM= SRV5_MAXPERM= # Prefix 6 SRV6_PREFIX= SRV6_MINHEAP= SRV6_MAXHEAP= SRV6_MINPERM= SRV6_MAXPERM= # Prefix 7 SRV7_PREFIX= SRV7_MINHEAP= SRV7_MAXHEAP= SRV7_MINPERM= SRV7_MAXPERM= # Prefix 8 SRV8_PREFIX= SRV8_MINHEAP= SRV8_MAXHEAP= SRV8_MINPERM= SRV8_MAXPERM= # Prefix 9 SRV9_PREFIX= SRV9_MINHEAP= SRV9_MAXHEAP= SRV9_MINPERM= SRV9_MAXPERM= # Set server name to AdminServer if not set if [ "${SERVER_NAME}" = "" ] ; then SERVER_NAME="AdminServer" export SERVER_NAME fi # Parameters associated with argument names MINHEAP=-Xms MAXHEAP=-Xmx MINPERM=-XX:PermSize= MAXPERM=-XX:MaxPermSize= # Figure out which server is being started for num in 1 2 3 4 5 6 7 8 9; do prefix_name=SRV${num}_PREFIX # Check if matching server # Ignore empty prefixes if [ "${!prefix_name}" != "" ] ; then if [[ ${SERVER_NAME} == ${!prefix_name}* ]] ; then # Found server so now get memory parameters USER_MEM_ARGS= for arg in MINHEAP MAXHEAP MINPERM MAXPERM; do arg_name=SRV${num}_${arg} # If no value revert to default value if [ "${!arg_name}" = "" ] ; then arg_name=DEFAULT_${arg} fi # If no value then ignore parameter if [ "${!arg_name}" != "" ] ; then USER_MEM_ARGS="${USER_MEM_ARGS} ${!arg}${!arg_name}" fi done echo USER_MEM_ARGS[${SERVER_NAME}]=${USER_MEM_ARGS} fi fi done # Make memory available outside script export USER_MEM_ARGS