As you might already know, JDBC is "stateful" in what it does. You have
a Connection, which creates Statements, and the combination of those two
track queries being run.
However, HTTP is a stateless protocol. As such, PQS has to cache things
in memory in order to make this approach work.
To this point, there are Connection and Statement caches which, once
they are not used, are evicted from the cache and closed. I know that
Phoenix is not capable of interrupting/free'ing all resources used by a
Phoenix query (e.g. you cannot interrupt an HBase RPC once it's
running), but it's likely that Phoenix would clean up the client-side
state to the best of its ability when the Statement/Connection are closed.
Maybe someone knows the answer to that off the top of their head.
Otherwise, hopefully this information is a starting point for you to
look at the code and/or run some experiments.