Arquillian with tomcat7 works in Java Heap Space problems, only on Linux

we are working arquillian with tomcat 7 ...
With my colleague's MAC, the test works fine, but on my Linux computer (we both have an 8 gigabyte drum) it does not work 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 run my test, I see this line on the stack:

14: 05: 56.482 INFO - launch Tomcat using: [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 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 xmx=512m on the stack.
I also added in pom.xml <argLine>-Xms2048m -Xmx2048m</argLine> for failsafe-maven-plugin and for maven-surefire-plugin , but still the same error ...

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

Thank you!

+4
source share
1 answer

It seems you are using an Arquillian-managed Tomcat 7 container. Use the javaVmArguments property in the javaVmArguments file to specify 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> 

A full reference to the properties supported by the Tomcat 7 managed container is in the Arquillian Confluence wiki .

+5
source

All Articles