aspose file tools*
The moose likes JDBC and the fly likes Large ResultSets causing OutOfMemory error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Large ResultSets causing OutOfMemory error" Watch "Large ResultSets causing OutOfMemory error" New topic
Author

Large ResultSets causing OutOfMemory error

Tim Vries
Greenhorn

Joined: Nov 29, 2001
Posts: 8
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?
Tim Vries
Greenhorn

Joined: Nov 29, 2001
Posts: 8
Solved my own problem. Stupid mistake. The ResultSet was setup as scrollable so it read the whole ResultSet into memory.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Large ResultSets causing OutOfMemory error