• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Large ResultSets causing OutOfMemory error

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic