What is an OutOfMemoryError and how do I debug and fix it

前端 未结 4 1959
猫巷女王i
猫巷女王i 2020-11-22 10:24

My Java program threw an OutOfMemoryError. How do I debug and fix this problem?


Many newcomers to Java struggle to cope with an OutOfMemoryE

4条回答
  •  青春惊慌失措
    2020-11-22 10:52

    This problem occur when tomcat goes out of memory i.e tomcat has less memory configured then the application required to run application.

    So to overcome this problem go to the tomcat bin directory and create a new file setenv.bat and define PermSize in that file as below:

    set JAVA_OPTS=-Dfile.encoding=UTF-8 -Xms512m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=1024m

    PermSize can be set to more higher range according to the application requirement.

提交回复
热议问题