Maven project reports memory overflow after using the tomcat plugin to start

http://blog.csdn.net/shiyong1949/article/details/52536689

Question:
The maven project is started after the tomcat plugin is configured in pom.xml, and the memory overflows when running.
The tomcat plugin is configured as follows:

<plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <version>${tomcat.version}</version>
                <configuration>
                    <port>${webserver.port}</port>
                    <path>/${project.artifactId}</path>
                    <uriEncoding>${project.build.sourceEncoding}</uriEncoding>
                </configuration>
            </plugin>





6
7
8
9
10 The
errors are as follows:
java.lang.OutOfMemoryError: PermGen space

Reason:
The java virtual machine does not have enough space to load classes, and the permanent memory is exceeded, mainly because the jars or classes loaded are too many after the project function is increased.

Solution:
Increase the jvm memory, add the following configuration in the maven run configuration, and expand the initialization memory.
-Xms1024M -Xmx2048M -XX:PermSize=256M -XX:MaxNewSize=256M -XX:MaxPermSize=512M

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326449891&siteId=291194637