weblogic启动出现 java.lang.OutOfMemoryError: PermGen space 不难发现是内存溢出的问题,一开始以为加大内存和最大非堆内存就可以了,但是盲目的加大即使加再大也不一定能解决不了问题
解决方法如下:
打开weblogic安装目录下的\user_projects\domains\base_domain\bin中的setDomainEnv.cmd
修改前:
set WLS_HOME=%WL_HOME%\server
if "%JAVA_VENDOR%"=="Sun" (
set WLS_MEM_ARGS_64BIT=-Xms256m -Xmx512m
set WLS_MEM_ARGS_32BIT=-Xms256m -Xmx512m
) else (
set WLS_MEM_ARGS_64BIT=-Xms512m -Xmx512m
set WLS_MEM_ARGS_32BIT=-Xms512m -Xmx512m
)
set MEM_ARGS_64BIT=%WLS_MEM_ARGS_64BIT%
set MEM_ARGS_32BIT=%WLS_MEM_ARGS_32BIT%
if "%JAVA_USE_64BIT%"=="true" (
set MEM_ARGS=%MEM_ARGS_64BIT%
) else (
set MEM_ARGS=%MEM_ARGS_32BIT%
)
set MEM_PERM_SIZE_64BIT=-XX:PermSize=128m
set MEM_PERM_SIZE_32BIT=-XX:PermSize=48m
if "%JAVA_USE_64BIT%"=="true" (
set MEM_PERM_SIZE=%MEM_PERM_SIZE_64BIT%
) else (
set MEM_PERM_SIZE=%MEM_PERM_SIZE_32BIT%
)
set MEM_MAX_PERM_SIZE_64BIT=-XX:MaxPermSize=256m
set MEM_MAX_PERM_SIZE_32BIT=-XX:MaxPermSize=128m
修改后:
set WLS_HOME=%WL_HOME%\server
if "%JAVA_VENDOR%"=="Sun" (
set WLS_MEM_ARGS_64BIT=-Xms512m -Xmx512m
set WLS_MEM_ARGS_32BIT=-Xms512m -Xmx512m
) else (
set WLS_MEM_ARGS_64BIT=-Xms512m -Xmx512m
set WLS_MEM_ARGS_32BIT=-Xms512m -Xmx512m
)
set MEM_ARGS_64BIT=%WLS_MEM_ARGS_64BIT%
set MEM_ARGS_32BIT=%WLS_MEM_ARGS_32BIT%
if "%JAVA_USE_64BIT%"=="true" (
set MEM_ARGS=%MEM_ARGS_64BIT%
) else (
set MEM_ARGS=%MEM_ARGS_32BIT%
)
set MEM_PERM_SIZE_64BIT=-XX:PermSize=128m
set MEM_PERM_SIZE_32BIT=-XX:PermSize=512m
if "%JAVA_USE_64BIT%"=="true" (
set MEM_PERM_SIZE=%MEM_PERM_SIZE_64BIT%
) else (
set MEM_PERM_SIZE=%MEM_PERM_SIZE_32BIT%
)
set MEM_MAX_PERM_SIZE_64BIT=-XX:MaxPermSize=256m
set MEM_MAX_PERM_SIZE_32BIT=-XX:MaxPermSize=1024m
修改完成后保存设置,重启weblogic即可