Hi! I’m writing bpm tests and getting an error:
java.lang.OutOfMemoryError: Java heap space
Within the entire test suite, there are 10 bpm tests, with 100+ cases total. The test suite runs through each process and making assertions against the processes using the BPMNAwareTests library. After some heap dumps, I’ve found that the setup was fine, but the tear down is not.
I’ve set up my tests like so:
beforeSpec {
init(processEngine)
}
I’m tearing down in this fashion to no avail:
afterSpec {
processEngine.close()
reset()
}
For ref, I am using Camunda + Kotlin + Micronaut’s Kotest Library.
Initial gradle Daemon settings: -Xms256m –Xmx512m
Gradle test executor settings: Xmx512m
org.gradle.wrapper.GradleWrapperMain test: -Xmx64m -Xms64m.
When using this above tear-down, heap usage went from ~400MB to just under ~200 so there’s progress, although it still hangs and runs out of memory. Using the dominator tree in Eclipse memory analyzer, I can see that there’s some org.apache.ibatis.session.defaults.DefaultSqlSessionFactory
that takes up double digit percentage of my bytes available.
Is there a way to manage sessions or to properly tear down the engines within a test suite this large?