`OutOfMemoryError` is returned during SQL execution

2024-08-09 02:52:24  Updated

Symptom

If the query returns a large number of data records, such as more than 1 billion rows, the query execution is slow and an OOM error is reported.

Unhandled exception, type=IllegalStateException, message=java.util.concurrent.ExecutionException:java.lang.OutOfMemoryError:Java heap space

Possible causes

This is a JDBC driver defect. If you set the Query Result Limit parameter to a large value in the SQL window of ODC, the JDBC driver forcibly applies for the corresponding memory space. A large value of the Query Result Limit parameter will therefore deplete the ODC memory. If you execute multiple queries, the OOM error is reported.

Affected versions

All versions of client ODC and web ODC

Solutions

Solution 1

Set the Query Result Limit parameter based on your business requirements.

Solution 2

Upgrade ODC to V3.3.1 or later, which restricts the maximum number of query results.

Contact Us