The tests.jvmargs option can be used to specify JVM options for JUnit processes, for example to limit memory usage. For example:
ant test:runone -Dtest.runone=PublisherTest -Dtests.jvmargs="-Xmx1m -XX:OnOutOfMemoryError='kill -9 %p'"
This property is only respected in modules/systemtests and modules/ejbca-webtests, so it is not applied for the other modules (which contain the unit tests)
This causes out-of-memory problems on Jenkins from time to time, in the unit test jobs.
To verify that it works:
Set it to a very low value, like
-Dtests.jvmargs="-Xmx1m -XX:OnOutOfMemoryError='kill -9 %p'"
If the option is working, there should be an out-of-memory error.
This should be tested with one test in each module (or with test:runsa, which runs all tests)