Java.lang.OutOfMemoryError constant: PermGen Arquillian + Wildfly 8.1 space

Hello new project. One of the first things I wanted to do was get the Arkillian to tune in and roll. I have a couple of JSF controllers and forms.

Dependency loading process

final File[] files = Maven.resolver().loadPomFromFile("pom.xml").importRuntimeAndTestDependencies().resolve()
                .withTransitivity().asFile();
LOG.info(files.toString());
final WebArchive archive = ShrinkWrap.create(WebArchive.class, "main-webapp-arq.war"); etc...

      

run

mvn -PprofileName package

      

everything seems to be smooth, I can see it start to run wildfly, then I can see it deploy the application, start the beans fire, after which I get:

....
[0m[0m20:37:30,025 INFO  [org.apache.shiro.web.env.EnvironmentLoader] (MSC service thread 1-6) Shiro environment initialized in 123 ms.
[0mINFO  [javax.enterprise.resource.webcontainer.jsf.config] Initializing Mojarra 2.2.6-jbossorg-4 20140501-1134 for context '/hc'
WARN  [org.jboss.modules] Failed to define class javax.faces.FactoryFinder in Module "javax.faces.api:main" from local module loader @732e8099 (finder: local module finder @71fcf7e2 (roots: /Users/jgreenaw/dev/apps/wildfly/wildfly-8.1.0.Final-ARQ/modules,/Users/jgreenaw/dev/apps/wildfly/wildfly-8.1.0.Final-ARQ/modules/system/layers/base)): java.lang.OutOfMemoryError: PermGen space

WARN  [org.jboss.modules] Failed to define class com.sun.faces.application.ApplicationAssociate in Module "com.sun.jsf-impl:main" from local module loader @732e8099 (finder: local module finder @71fcf7e2 (roots: /Users/jgreenaw/dev/apps/wildfly/wildfly-8.1.0.Final-ARQ/modules,/Users/jgreenaw/dev/apps/wildfly/wildfly-8.1.0.Final-ARQ/modules/system/layers/base)): java.lang.OutOfMemoryError: PermGen space...

      

after which other services fail to load for the same reason.

I went and did the obvious, such as over pergen in maven and wildfly up to 512mb, then up to 1024mb. It seems that something is fundamentally wrong. I can run the entire application without any adjustments.

Arquillian.xml

<?xml version="1.0" encoding="UTF-8"?>
<arquillian xmlns="http://jboss.org/schema/arquillian"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

    <container qualifier="wildfly" default="true">
        <configuration>
            <!-- Supported property names: [managementPort, username, managementAddress, 
                bundlePath, managementProtocol, cleanServerBaseDir, jbossHome, password, 
                modulePath] -->
            <property name="jbossHome">/dev/apps/wildfly/wildfly-8.1.0.Final-ARQ/</property>
            <property name="modulePath">/dev/apps/wildfly/wildfly-8.1.0.Final-ARQ/modules</property>
            <property name="javaVmArguments">-Xms64m -Xmx1024m -XX:MaxPermSize=1024m -Dorg.jboss.resolver.warning=true</property>
        </configuration>
    </container>
</arquillian> 

      

The relevant (I think) pom dependencies are:

<dependency>
    <groupId>org.jboss.arquillian</groupId>
    <artifactId>arquillian-bom</artifactId>
    <version>1.1.5.Final</version>
</dependency>
<dependency>
    <groupId>org.jboss.arquillian.junit</groupId>
    <artifactId>arquillian-junit-container</artifactId>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>org.jboss.shrinkwrap.resolver</groupId>
    <artifactId>shrinkwrap-resolver-impl-maven</artifactId>
    <scope>test</scope>
</dependency>
<profiles>
    <profile>
        <!-- Remote local Profile - Arquillian will deploy the test artifact to 
                a local server, test the artifact and undeploy -->
        <id>arq-wildfly-local</id>
        <activation>
            <activeByDefault>false</activeByDefault>
        </activation>
        <properties>
            <skipTests>false</skipTests>
        </properties>
        <dependencies>
            <dependency>
                <groupId>org.wildfly</groupId>
                <artifactId>wildfly-arquillian-container-embedded</artifactId>
                <version>8.1.0.Final</version>
                <scope>test</scope>
            </dependency>
        </dependencies>

      

Past experience shows that I have missed something fundamental, and that tolerating the end is a sign of something else, I am doing it wrong. I've tried various .import .... in the Maven resolver to no avail. Same command line line in eclipse.

java version "1.7.0_60" Apache Maven 3.2.1 wildfly 8.1 OS X Latest

Question: Any idea where to go next? Thanks in advance.

+3


source to share


1 answer


if you are using linux then you can use the .bashrc profile put this command.

export MAVEN_OPTS = "- Xmx1024m -XX: MaxPermSize = 256m" and then reset the terminal.

Or you can set this in an environment variable.



Alternatively, you can set these values ​​in Maven command line arguments using this command

-DXmx512m -DXX: MaxPermSize = 512 m

0


source







All Articles