Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Large ResultSets causing OutOfMemory error

 
Tim Vries
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Solved my own problem. Stupid mistake. The ResultSet was setup as scrollable so it read the whole ResultSet into memory.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic