4

we are running arquillian with tomcat 7...
With the MAC from my colleague the test works fine, but at my linux computer (we both have 8gb ram) it failes with:

FATAL: Error waiting for multi-thread deployment of WAR files to complete
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space

when i start my test, i see in the stack this line:

14:05:56.482 INFO - Starting Tomcat with: [java, -Dcom.sun.management.jmxremote.port=8089, -Dcom.sun.management.jmxremote.ssl=false, -Dcom.sun.management.jmxremote.authenticate=false, -Xmx512m, -XX:MaxPermSize=128m, -classpath, /home/user/apache-tomcat-testing/bin/bootstrap.jar:/home/user/apache-tomcat-testing/bin/tomcat-juli.jar, -Djava.endorsed.dirs=/home/user/apache-tomcat-testing/endorsed, -Dcatalina.base=/home/user/apache-tomcat-testing, -Dcatalina.home=/home/user/apache-tomcat-testing, -Djava.io.tmpdir=/home/user/apache-tomcat-testing/temp, org.apache.catalina.startup.Bootstrap, -config, /home/user/apache-tomcat-testing/conf/server.xml, start]

i tried to edit the bin/catalina.sh with

JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms2048m -Xmx2048m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=512m -XX:+DisableExplicitGC"

but it still has the xmx=512m in the stack.
i also added in the pom.xml the <argLine>-Xms2048m -Xmx2048m</argLine> for failsafe-maven-plugin and for the maven-surefire-plugin but still the same error...

Where is the right place to change the xmx for the arquillian testing?

thank you!

Joergi
  • 1,527
  • 3
  • 39
  • 82

1 Answers1

5

It appears that you're using the Arquillian managed Tomcat 7 container. Use the javaVmArguments property in arquillian.xml to specify the Xmx values:

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

    <container qualifier="tomcat" default="true">
        <configuration>
            <property name="catalinaHome">${CATALINA_HOME:target/apache-tomcat-7.0.20}</property>
            <property name="javaVmArguments">-Xms2048m -Xmx2048m</property>
            <property name="jmxPort">8089</property>
            <property name="bindHttpPort">8080</property>
            <property name="user">manager</property>
            <property name="pass">password</property>
            <property name="serverConfig">server.xml</property>
        </configuration>
    </container>
</arquillian>

The complete reference to the properties supported for the managed Tomcat 7 container is in the Arquillian Confluence wiki.

Vineet Reynolds
  • 76,006
  • 17
  • 150
  • 174
  • how a bout the PermGen space problem with Maven and arquillian on managed tomcats. Will this solve the PermGen space problem also, or not? – Yashar Aug 19 '13 at 10:22
  • @Yashar No, set the `MaxPermSize` and `PermSize` arguments for perm gen issues. And allow Arquillian to restart Tomcat on after `n` deployments. There is a configuration property for the latter. – Vineet Reynolds Aug 19 '13 at 11:10
  • The javaVmArguments option also works for Wildfly 8.1.0. although I could not find the corresponding documentation. – Gerrit Brouwer Nov 17 '14 at 08:27