Appropriate place in catalina.bat to set JAVA_OPTS

前端 未结 5 1908
天涯浪人
天涯浪人 2020-12-31 20:12

I got the below error

\"java.lang.OutOfMemoryError: PermGen space\"

In my catalina.bat file, where is the appropriate place f

5条回答
  •  暖寄归人
    2020-12-31 20:54

    Like others have already suggested you need to use JAVA_OPTS set to something like: JAVA_OPTS="-XX:MaxPermSize=98m". This, alone, will probably solve the issues, but if you are redeploying a lot of times and your war/jar is huge you will hit this memory limit too.

    For this last scenario, something normal on a test/devel machines, I recommend using:

    -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC

    This options will enable the unloading of the unused classes.

    Look here more details, especially the comments.

提交回复
热议问题