Search code examples
sbtspecs2spray

JVM memory settings for specs2


SBT keeps running out of memory on some of my bigger acceptance style tests using specs2 and spray-testkit. I have 10 gigs or RAM available and currently I start SBT (using the SBT extras script) with MaxPermSize at 512m, Xms at 1024m and Xmx at 2g.

The acceptance test runs through a client's entire business process in specific sequence, so it's not easy to split the acceptance test in to multiple smaller tests.

Any ideas how I can configure my environment better, or gotcha's that I should look out for will be appreciated.

For what it's worth, I'm using Oracle Java under Ubuntu, and the project uses Scala 2.10, sbt 0.12.2, spray 1.1-M7 with specs2 1.14.

When running the system outside of test, or when using smaller tests, everything runs like clockwork. It's only during larger tests that things go nutty.


Solution

  • I suspect you're hitting the exponential problem with the specs2 immutable style. The solution is simply to add more memory or bust your tests up into smaller chunks. More info is here:

    http://www.artima.com/articles/compile_time.html