Support Questions

Find answers, ask questions, and share your expertise
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

Inner join Phoenix query out of memory ?



I execute an inner join on 2 tables of 10 Millions records each and i have an outofmemory issue.

The columns are both indexed.



Error: Encountered exception in sub plan [0] execution. (state=,code=0) java.sql.SQLException: Encountered exception in sub plan [0] execution. at org.apache.phoenix.execute.HashJoinPlan.iterator( at org.apache.phoenix.execute.HashJoinPlan.iterator( at org.apache.phoenix.execute.HashJoinPlan.iterator( at org.apache.phoenix.jdbc.PhoenixStatement$ at org.apache.phoenix.jdbc.PhoenixStatement$ at at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery( at org.apache.phoenix.jdbc.PhoenixStatement.execute( at sqlline.Commands.execute( at sqlline.Commands.sql( at sqlline.SqlLine.dispatch( at sqlline.SqlLine.begin( at sqlline.SqlLine.start( at sqlline.SqlLine.main( Caused by: java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf( at at at at at org.apache.phoenix.util.TupleUtil.write( at org.apache.phoenix.join.HashCacheClient.serialize( at org.apache.phoenix.join.HashCacheClient.addHashCache( at org.apache.phoenix.execute.HashJoinPlan$HashSubPlan.execute( at org.apache.phoenix.execute.HashJoinPlan$ at org.apache.phoenix.execute.HashJoinPlan$ at at org.apache.phoenix.job.JobManager$ at java.util.concurrent.ThreadPoolExecutor.runWorker( at java.util.concurrent.ThreadPoolExecutor$ at


Increase the maximum Java heap space in your client.

New Contributor

@Helmi KHALIFA I have the same problem,I don't know where can find this property "phoenix.query.maxServerCacheBytes".

New Contributor

@Josh Elser Can you pls. guide me, how and where to set the Java heap space on the client ?

I have windows machines where my app runs and the phoenix queries are trigger from these windows system. I see no logs on the server side, I believe, the query is failing on the client side itself.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.