When running Arquillian tests from Gradle on Mac OS X (Mavericks) I regularly (but not always) get the following error (but sadly only if I have the Gradle --debug
flag set). The build then hangs:
10:57:34.181 [QUIET] [system.out] 10:57:34.181 [QUIET] [system.out] 10:57:34,180 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss AS 7.1.3.Final "Arges" started in 4178ms - Started 218 of 303 services (85 services are passive or on-demand)
10:57:36.583 [DEBUG] [TestEventLogger]
10:57:36.583 [DEBUG] [TestEventLogger] Gradle test STARTED
10:57:43.501 [DEBUG] [TestEventLogger]
10:57:43.502 [DEBUG] [TestEventLogger] Gradle test STANDARD_ERROR
10:57:43.502 [DEBUG] [TestEventLogger] Exception in thread "management-client-thread 1-1" java.lang.OutOfMemoryError: Java heap space
10:57:43.502 [DEBUG] [TestEventLogger] at java.util.Arrays.copyOf(Arrays.java:2271)
10:57:43.502 [DEBUG] [TestEventLogger] at java.io.ByteArrayOutputStream.toByteArray(ByteArrayOutputStream.java:178)
10:57:43.502 [DEBUG] [TestEventLogger] at org.jboss.as.controller.client.impl.InputStreamEntry$InMemoryEntry.initialize(InputStreamEntry.java:82)
10:57:43.503 [DEBUG] [TestEventLogger] at org.jboss.as.controller.client.impl.AbstractModelControllerClient$ReadAttachmentInputStreamRequestHandler$1.execute(AbstractModelControllerClient.java:193)
10:57:43.503 [DEBUG] [TestEventLogger] at org.jboss.as.protocol.mgmt.AbstractMessageHandler$2$1.doExecute(AbstractMessageHandler.java:296)
10:57:43.503 [DEBUG] [TestEventLogger] at org.jboss.as.protocol.mgmt.AbstractMessageHandler$AsyncTaskRunner.run(AbstractMessageHandler.java:518)
10:57:43.504 [DEBUG] [TestEventLogger] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
10:57:43.504 [DEBUG] [TestEventLogger] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
10:57:43.504 [DEBUG] [TestEventLogger] at java.lang.Thread.run(Thread.java:722)
10:57:43.504 [DEBUG] [TestEventLogger] at org.jboss.threads.JBossThread.run(JBossThread.java:122)
I've played with the javaVmArguments seting in my arquillian.xml file to bump up the memory. Figuring it works occasionally with 1024m of memory, I tried 2048m and 4096m, but to no avail.
<configuration>
<property name="jbossHome">target/platform-dist/jboss-as-7.1.3.Final</property>
<property name="serverConfig">standalone-test.xml</property>
<property name="javaVmArguments">-Xmx2048m -XX:MaxPermSize=256m -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8987,suspend=n -Darquillian.testing=true</property>
</configuration>
I've even added memory to Gradle:
echo $GRADLE_OPTS
-Xms1024m -Xmx2048m -XX:MaxPermSize=512m
Has anyone else run into this? Is there a different place to add memory?
Thanks.