digifork <digifork(at)gmail(dot)com> wrote:
> When I start the query, it takes some time to return the first
> row. When the query is about to return the first row, there is a
> giant spike in heap memory use and the the JVM runs out of memory.
Unless you go out of your way to prevent it, the entire result set
is cached on the heap during invocation of the execute method. You
can avoid this by using a cursor:
http://jdbc.postgresql.org/documentation/head/query.html#query-with-cursor
-Kevin