Hi, The safest option is to configure surefire to spawn a new JVM for each test class: <reuseForks>false</reuseForks> [1]. That will of cause give you some considerable bump in the execution time.
Good luck, Andreas [1] http://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html 2013/5/3 laredotornado-3 <[email protected]> > Hi, > > I'm using Maven 3.0.3. Is it possible to configure Maven or the Surefire > plugin to recover from OutOfMemoryErrors? I notice with my JUnit tests, if > one test from file A fails with an "OutOfMemoryError," all subsequent tests > in my Maven Junit run (even those from different files) fail with > OutOfMemoryErrors. When I run the files in isolation (e.g. > "-Dtest=FileATest"), the test runs fine. > > I'm using the Surefire 2.14.1: > > <plugin> > <groupId>org.apache.maven.plugins</groupId> > > <artifactId>maven-surefire-plugin</artifactId> > <version>2.14.1</version> > </plugin> > > Thanks for any wisdom, - Dave > > > Here's an example of one of the OutOfMemoryErrors … > > Exception in thread "Poller SunPKCS11-Darwin" java.lang.OutOfMemoryError: > Java heap space > at sun.security.pkcs11.wrapper.PKCS11.C_GetSlotInfo(Native Method) > at sun.security.pkcs11.SunPKCS11.initToken(SunPKCS11.java:767) > at sun.security.pkcs11.SunPKCS11.access$100(SunPKCS11.java:42) > at > sun.security.pkcs11.SunPKCS11$TokenPoller.run(SunPKCS11.java:700) > at java.lang.Thread.run(Thread.java:680) > > > > > > -- > View this message in context: > http://maven.40175.n5.nabble.com/Can-Maven-recover-from-OutOfMemoryErrors-during-JUnit-test-runs-tp5754845.html > Sent from the Maven - Users mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
