Java out of memory using PostgreSQL Java out of memory using PostgreSQL postgresql postgresql

Java out of memory using PostgreSQL


  1. Set the fetch size to something reasonable (st.setFetchSize(rowCount)). You can experiment with this.
  2. Put everything in a transaction with autocommit off (con.setAutoCommit(false)).

See this explanation and the documentation.