Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hi all problem in resultset

 
narasimharao konjeti
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
I am getting one problem, while retriving data.. i am retring around one crore records from different(4) tables. and putting into resultset. after some time it is giving OUTOFMEMORYEXCEPTION. i tried with different, options, but no results, could anyone tell the solution for this problem
regards
nr konjeti
 
Lu Battist
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Without seeing specific code, I can only give you some general advice.
Limit the sql query to not return so much data by adding more to the where clause or by setting a row limit on the results returned.
Additionally for large result sets, try to get all your processing done inside the resultset loop so that you don't have to store everything in memory.
As a last resort, play with the java -X options for ms and mx that allow more memory.
 
Kishore Dandu
Ranch Hand
Posts: 1934
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My first feelings are that you may need to improvize the query to return less than the number of records you are mentioning.
1 crore(ie 10 million) is a large number of records to go through for any kind of programmatic processing.
I would suggest you normalize your query to bring the necessary number of entries and do some more normalization on your JDBC resultset area if needed.
Kishore.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic