I have ~200 unit tests and integration tests for our application. We were using RMI EhCache before and all the unit tests were used to run fine on our build machine.
We have recently migrated to using terracotta server for caching solution and since then we started seeing PermSpace out of memory error. We have increased the JVM memory space using java options but we still keep hitting lot of memory issues. Is anyone else facing memory issues with terracotta enabled for caching?
How are you spawning the servers (L2) and clients (L1) in your unit test ? If you are spawning a new L1 for every test while reusing the same JVM, I can see how you might run out of perm gen. This is probably just a test setup issue.
Can you try running each test as a separate test, spawning a new VM everytime ? The other thing to try is not spawn a new L1 but reuse the same L1 and run each test within the same L1. Dunno if thats possible with your test setup.
You could look at how the tests are setup in our source repository. We spawn L2s externally and run most tests individually in their own VM.