When assertions are enabled (java -ea) the following test case
try (Connection conn = DriverManager.getConnection("jdbc:h2:./test", "sa", "");
Statement statement = conn.createStatement()) {
statement.execute("DROP ALL OBJECTS");
statement.execute("CREATE TABLE TEST AS (SELECT ARRAY_AGG(REPEAT('A', 1000000)) B"
+ " FROM SYSTEM_RANGE(1, 30))");
}
fails with AssertionError, because MemoryEstimator.estimateMemory() returns -7105612 at some point.
This issue causes a failure in H2GIS with relatively small GEOMETRY value.