Large .exec being generated

408 views
Skip to first unread message

ric....@gmail.com

unread,
Jun 10, 2014, 6:38:18 PM6/10/14
to jac...@googlegroups.com
Hello,

I am generating a .exec file using the maven plugin. The .exec file that is being generated is around 1gig. This seems excessive for the project the file is generated for. The project is 1472 files, 2107 classes and 92,000 lines of code. I wouldn't be overly concerned about the exec file size, except it results in Sonar chucking OOM exceptions trying to analyze the exec file.

I am using Java 7, JaCoCo - 0.7.1.201405082137, Surefire - 2.17 . I have read that large exec files can be produced if unit tests are being run in forked JVMs for each test. I am not forking multiple unique test JVMs. When I look at the generated coverage reports (HTML), there are sessions listed for each test case and a bunch of sessions with no session id. I would think that there should only be a single session for a test run?

Here is the surefire config

<plugin>
<!-- Used to fire of Junits -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>2.17</version>
</dependency>
</dependencies>
<configuration>
<argLine>-Xmx512m -XX:MaxPermSize=256m ${jacoco.agent.ut.arg}</argLine>
<properties>
<property>
<name>listener</name>
<value>org.sonar.java.jacoco.JUnitListener</value>
</property>
</properties>
</configuration>
</plugin>

Here is the jacoco config

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.1.201405082137</version>
<executions>
<!-- Prepares a variable, jacoco.agent.ut.arg, that contains the info to be passed to the JVM hosting the code
being tested. -->
<execution>
<id>prepare-ut-agent</id>
<phase>process-test-classes</phase>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<destFile>${sonar.jacoco.reportPath}</destFile>
<propertyName>jacoco.agent.ut.arg</propertyName>
<append>true</append>
<skip>${sonar.jacoco.skip}</skip>
<includes>
<include>com.denmartech.*</include>
</includes>
</configuration>
</execution>
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<configuration>
<dataFile>${sonar.jacoco.reportPath}</dataFile>
<outputDirectory>${project.build.directory}/coverage-reports</outputDirectory>
</configuration>
</plugin>

I can generate a coverage report from the large .exec. But, the file is just too big for Sonar. I have monkeyed with the JVM params to increase available memory for Sonar, I have not found the right level of memory yet. I am thinking though that I am treating the symptom and not the underlying problem.

Any suggestions would be appreciated.

Thanks

Marc R. Hoffmann

unread,
Jun 11, 2014, 11:37:45 AM6/11/14
to jac...@googlegroups.com
Hi,

the reason for the big exec file is the org.sonar.java.JUnitListener you
configured. It dumps all execution data after every single test case.
This allows Sonar to createeorg.sonar.java.jacoco.JUnitListener a "per
test" coverage report.

If you just want to see the overall code coverage just remove the Sonar
JUnitListener -- it is not required. If you're looking for a "per test"
coverage report please report the OOM to SonarQube.

Best regards,
-marc

ric....@gmail.com

unread,
Jun 11, 2014, 11:58:45 AM6/11/14
to jac...@googlegroups.com
Thank you. That solved my problem.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages