java.lang.OutOfMemoryError ( PermGen space) and java.lang.ClassNotFoundException at the opening the jsp page

后端 未结 4 1311
梦谈多话
梦谈多话 2021-01-12 00:59

I use SpringSource Tool Suite 3.0.1, Tomcat server 7.0.21, maven-2.2.1. I successfully built my web application, ran Tomcat server. The application successfully worked. Aft

相关标签:
4条回答
  • 2021-01-12 01:42

    Just an expanded version of Bogdan's answer
    1. At the Main menu go to Window -> Show View -> Servers
    2. At the 'Servers' View double click on 'Tomcat'
    3. A Tomcat Overview page will be opened
    4. Find 'General Information' section and click on 'Open launch configuration'
    5. At the 'Edit Configuration' popup go to Arguments tab
    6. Find 'VM arguments' section and place -Xmx1024m -XX:MaxPermSize=512m there
    7. Click 'OK' and start your Tomcat.

    0 讨论(0)
  • 2021-01-12 01:43

    This depends on which file you are running, either catalina.bat or catalina.sh. Set the Java options as below and try:

    set JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG% -Xms512m -Xmx512m -XX:PermSize=512m -XX:MaxPermSize=1024m
    
    0 讨论(0)
  • 2021-01-12 01:50

    For the OutOfMemory error make sure you have the following parameters set (and with a respectable value)

    -Xmx1024m -XX:MaxPermSize=512m
    

    EDIT:

    512m and 1024m are just suggestions! You might need to tweek these settings to your hardware resources.

    Usually you should start from somewhere around 128m and each time you get an OutOfMemory error try to double the amount allocated.

    For e.g.:

    • you have 256m for MaxPermSize and you get OutOfMemory - the new threshold should be set at 512m

    • you have 512m for MaxPermSize and you get OutOfMemory - the new threshold should be set at 1G

    More details about tuning JVM parameters can be found in the Java official documentation at Oracle.

    0 讨论(0)
  • 2021-01-12 01:55

    It looks like tomcat is falling over compiling the JSPs, you might want to consider precompiling the JSPs (which would have the added benefit of checking the JSPs for syntax errors before you deploy your app).

    See also: How can I make Tomcat pre-compile JSPs on startup?

    0 讨论(0)
提交回复
热议问题