PermGen space with pier

I am developing a Java application where I use a mavenlike project management tool. Now my problem is that if I installed a berth for autoscanning every 20 seconds this way:

<!-- To launch embded jetty server -->
       <plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <version>${maven-jetty-plugin.version}</version>
            <configuration>
                <scanIntervalSeconds>10</scanIntervalSeconds>
                <webAppConfig>
                    <contextPath>/${project.name}</contextPath>
                    <extraClasspath>target/classes;../services/target/classes;</extraClasspath>
                </webAppConfig>
                <scanTargets>
                    <scanTarget>target/classes</scanTarget>
                    <scanTarget>../services/target/classes</scanTarget>
                </scanTargets>
            </configuration>
        </plugin>

The berth starts in the right way, I get:

[INFO] Jetty Server

[INFO] Start the scanner at intervals of 20 seconds.

But on the first scan, I get the following error:

ERROR ContextLoader - Error initializing context

java.lang.OutOfMemoryError: PermGen space

How can i fix this?

Update 1

I am trying to tear out the Permengen space from my Eclipse Ide in this way:

enter image description here

but after the first scan, I will return to the same error.

How can i fix this?

+4
source share
3

<configuration>: <jvmArgs>-XX:PermSize=256M -XX:MaxPermSize=512M</jvmArgs>

, Maven :

<!-- To launch embded jetty server -->
       <plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <version>${maven-jetty-plugin.version}</version>
            <configuration>
                <jvmArgs>-XX:PermSize=256M -XX:MaxPermSize=512M</jvmArgs>
                <scanIntervalSeconds>10</scanIntervalSeconds>
                <webAppConfig>
                    <contextPath>/${project.name}</contextPath>
                    <extraClasspath>target/classes;../services/target/classes;</extraClasspath>
                </webAppConfig>
                <scanTargets>
                    <scanTarget>target/classes</scanTarget>
                    <scanTarget>../services/target/classes</scanTarget>
                </scanTargets>
            </configuration>
        </plugin>

. , , .

+3

MaxPermGen -XX: MaxPermSize = 512m MAVEN_OPTS.

+1
source

Source: https://habr.com/ru/post/1525430/


All Articles