Error querying database.Ran out of memory retrieving query results

Error querying database.Ran out of memory retrieving query results

查询数据库时出错 检索查询结果时内存不足

错误日志

Error querying database.  Cause: org.postgresql.util.PSQLException: Ran out of memory retrieving query results.↵
### The error may exist in class path resource [xxxMapper.xml]↵### The error may involve defaultParameterMap↵
### The error occurred while setting parameters↵### SQL: SELECT         *         FROM         "TB1"     ### Cause: org.postgresql.util.PSQLException: Ran out of memory retrieving query results.↵
; SQL []; Ran out of memory retrieving query results.; nested exception is org.postgresql.util.PSQLException: Ran out of memory retrieving query results."  

错误原因是应为查询的数据量太大,导致内存不足。

解决方法
请检查查询条件是否范围太大,如条件 不更改可以使用分页 获取前1000条等方法解决该问题。

你可能感兴趣的:(java,PostgreSql,java,sql,postgresql)