The memory usage has increased considerably after recent progress, to the point that the PostgreSQL specific suite is running in out of memory with the current heap settings.
Heap analysis shows that the main consumer is Mockito as we "spy" on many JDBC Connections, this is causing internal objects of Mockito to be allocated for each interaction with a Connection or any Statement. The testsuite performs a significant amount of invocations on these so the combination gets us above 4GB of memory usage.
I'm still investigating the Mockito internals to understand if this is by design or a leak, but in the meantime I've found some flags which we can apply to reduce this memory consumption, at the drawback of not being able to perform a "verification" on mock invocations.
It turns out that some tests need such verification, but to be safe I'm disabling this flag globally and allowing it to be enabled only explicitly. Not ideal as new tests will need to consider this limitation, but hopefully in the meantime I can figure out a proper fix for Mockito.