I have some particularly large ResultSets (200K+ rows) that I need to manipulate that are causing OutOfMemory errors when I try to run it. I can get around it but using some of the nonstandard command line options to increase the heap size (-Xms and -Xmx) or by using a reference cursor on the database, but that is not the ideal solution to my problem. Is there a way to fetch and process only X records at a time and then discard them from memory after I'm done?
Joined: Nov 29, 2001
Solved my own problem. Stupid mistake. The ResultSet was setup as scrollable so it read the whole ResultSet into memory.
subject: Large ResultSets causing OutOfMemory error