Skip to content

MemoryEstimator.estimateMemory() can return negative size #3361

@katzyn

Description

@katzyn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions