title: Constant java.lang.OutOfMemoryError: PermGen space Arquillian + Wildfly 8.1
body: <p>Hi started a new project.  One of the first things i wanted to do was get Arquillian set up and rolling.
  I have a couple controllers and JSF forms written.</p>
  
  <p>The process of loading up the dependencies </p>
  
  <pre><code>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...
  </code></pre>
  
  <p>run </p>
  
  <pre><code>mvn -PprofileName package
  </code></pre>
  
  <p>everything seems to go swimmingly, i see it starting to launch wildfly, then i see it deploy the app, the startup beans fire then i get:</p>
  
  <pre><code>....
  [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...
  </code></pre>
  
  <p>followed by other services failing on load for the same reason.</p>
  
  <p>I've gone and done the obvious like up'ing the permgen in maven and wildfly to 512mb then to 1024mb.  It seems something is fundamentally wrong.  I can run the entire application without adjusting anything.</p>
  
  <p>Arquillian.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;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"&gt;
  
      &lt;container qualifier="wildfly" default="true"&gt;
          &lt;configuration&gt;
              &lt;!-- Supported property names: [managementPort, username, managementAddress, 
                  bundlePath, managementProtocol, cleanServerBaseDir, jbossHome, password, 
                  modulePath] --&gt;
              &lt;property name="jbossHome"&gt;/dev/apps/wildfly/wildfly-8.1.0.Final-ARQ/&lt;/property&gt;
              &lt;property name="modulePath"&gt;/dev/apps/wildfly/wildfly-8.1.0.Final-ARQ/modules&lt;/property&gt;
              &lt;property name="javaVmArguments"&gt;-Xms64m -Xmx1024m -XX:MaxPermSize=1024m -Dorg.jboss.resolver.warning=true&lt;/property&gt;
          &lt;/configuration&gt;
      &lt;/container&gt;
  &lt;/arquillian&gt; 
  </code></pre>
  
  <p>Relevant (i think) pom dependencies:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.jboss.arquillian&lt;/groupId&gt;
      &lt;artifactId&gt;arquillian-bom&lt;/artifactId&gt;
      &lt;version&gt;1.1.5.Final&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.jboss.arquillian.junit&lt;/groupId&gt;
      &lt;artifactId&gt;arquillian-junit-container&lt;/artifactId&gt;
      &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.jboss.shrinkwrap.resolver&lt;/groupId&gt;
      &lt;artifactId&gt;shrinkwrap-resolver-impl-maven&lt;/artifactId&gt;
      &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;profiles&gt;
      &lt;profile&gt;
          &lt;!-- Remote local Profile - Arquillian will deploy the test artifact to 
                  a local server, test the artifact and undeploy --&gt;
          &lt;id&gt;arq-wildfly-local&lt;/id&gt;
          &lt;activation&gt;
              &lt;activeByDefault&gt;false&lt;/activeByDefault&gt;
          &lt;/activation&gt;
          &lt;properties&gt;
              &lt;skipTests&gt;false&lt;/skipTests&gt;
          &lt;/properties&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.wildfly&lt;/groupId&gt;
                  &lt;artifactId&gt;wildfly-arquillian-container-embedded&lt;/artifactId&gt;
                  &lt;version&gt;8.1.0.Final&lt;/version&gt;
                  &lt;scope&gt;test&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
  </code></pre>
  
  <p>past experience indicates i'm missing something fundamental, and that permgen running out is a sympton of something else i'm doing wrong.  I have tried various .import.... in the Maven resolver to no avail. Same problem command line and in eclipse.</p>
  
  <p>java version "1.7.0_60"
  Apache Maven 3.2.1
  wildfly 8.1
  OS X Latest</p>
  
  <p>Question: Any idea where to go next?  Thanks in advance.</p>