Aerospike Filter and Expressions

I have an aerospike client setup in spring boot Java, and I am trying to query a set with one filter and 2 or more expressions since aerospike does not support multiple secondary index filters.

Now with this setup , when two or more queries are done on the spring boot server, I am getting an error on the java terminal log as - java.lang.OutOfMemoryError: Java heap space.

below is the attached code snippet for the api:

    org.json.JSONObject query = new org.json.JSONObject(filter.get("filter").toString());
    Statement stmt = new Statement();
    stmt.setNamespace(NAMESPACE);
    stmt.setSetName(SET);
    System.out.println("Incoming query parameters: "+query);
    QueryPolicy queryPolicy = new QueryPolicy();
    queryPolicy.failOnFilteredOut = true;
    stmt.setFilter(Filter.equal("someKeyA",query.getInt("someKeyA")));
    queryPolicy.filterExp = Exp.build(Exp.and(
            Exp.eq(Exp.listBin("someKeyB"),Exp.val(query.getInt("someKeyB"))),
            Exp.eq(Exp.stringBin("someKeyC"),Exp.val(String.valueOf(query.getBoolean("someKeyC"))))
    ));
    RecordSet rs = asClient.query(null, stmt);
    ArrayList output = new ArrayList();
    while (rs.next()) {
        Record r = rs.getRecord();
        output.add(r.getValue("data"));
    }
    rs.close();
    return output;

Can anyone help on this , and state what is going wrong here?

Seems the JVM is unable to allocate more RAM. Maybe the output ArrayList has grown too large?