Out of Memory Error when using huge datasets
March 20th, 2009
Applies to:
NA
Description:
Occurs while using huge result sets.
Cause:
You have tried to use huge result set, for instance, more than with 100,000 rows.
Applies to:
NA
Description:
Occurs while using huge result sets.
Cause:
You have tried to use huge result set, for instance, more than with 100,000 rows.
JAVA-JDBC dataset outofmemory, error, lrm-00118: syntax error at '=' at the end of input, memory, oracle setmaxrows outofmemory, out of memory, out of memory with huge dataset
The best way to fix this problem is to not SELECT so many rows at one time. Use WHERE and/or HAVING and/or LIMIT type clauses to restrict the number of rows you return at one time. For a robust JDBC driver, Statement.setMaxRows(int max) can limit it too.
If you need to page data then you should also do that with the use of better SQL rather than seeking a Java only solution.
A further solution is often to change the scrolling type of your ResultSet? cursor to be type forward. Due to to the way many drivers implement scrolling in ResultSets? these types of Cursors can be very expensive.