Search code examples
ignitegridgaindistributed-cachingapacheignite

OOM for query execution


We are running into OOM when we run large number of SQL queries. We are using Apache Ignite 2.15. Pretty standard query code like below,

SqlFieldsQuery sqlQuery = new SqlFieldsQuery(query);
if (args != null) {
    sqlQuery.setArgs(args);
}
FieldsQueryCursor<List<?>> cursor = cache.query(sqlQuery);

Doing the heap analysis indicated, "org.apache.ignite.internal.processors.query.RunningQueryManager" having a map which maintains references of all the running queries. But does not seem to clean up the map post query execution.

On trying to look this up further, we found references to the same issue but no activity,

https://issues.apache.org/jira/browse/IGNITE-13130

Apache Ignite : Ignite on-heap cache occupying too much memory in heap. Causing the application to throw OutOfMemory exception

Any help appreciated.


Solution

  • On further debugging this as i was creating a reproducer. Found a deep hidden reference to cursor that wasn't closed. On closing that reference this issue was solved. Thanks.