There are two OutOfMemoryError that the weblogic server might throw if the memory settings are not tuned.
- java.lang.OutOfMemoryError: Java heap space
- The heap space error could be fixed by tunning Xms (minimum heap space) and Xmx (maximum heap space) parameters
- java.lang.OutOfMemoryError: PermGen space
- And perm gen error could be fixed by tunning the PermSize parameter.
How to change memory settings in weblogic
There are many ways to change it and no of the standard ways is to change the setDomainEnv.sh file and append the following lines at the end of the file.
Remember to restart the server for this setting to take effect.
echo "******Custom Memory Settings for UBM SOA servers******"
echo "Server Name ${SERVER_NAME}"
echo "Memory Arguments ${MEM_ARGS}"
if [ "${SERVER_NAME}" = "WLS_SERVER1" ] ; then
MEM_ARGS=" -Xms1024m -Xmx3584m -XX:PermSize=512m -XX:MaxPermSize=1536m "
export MEM_ARGS
fi
if [ "${SERVER_NAME}" = "AdminServer" ] ; then
MEM_ARGS=" -Xms1024m -Xmx2584m -XX:PermSize=512m -XX:MaxPermSize=1536m "
export MEM_ARGS
fi
How to verify
Run the ps -ef command in unix/Linux to check if the paratemers are passed correctly to the jvm
ps -ef | grep java | cut -c 1-200
And you can also see the actual memory usage at the OS level using top command.
No comments :
Post a Comment