Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ava.lang.OutOfMemoryError: Java heap space

 
Teresa Lee
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

When I tried to query a database table and created a bean to store each record that matched the criteria ( the resultSet it returned is pretty big), I have this problem. Anybody has any clues of how to fix it?

Thanks.
 
Vishal Matere
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
increase the JVM heap space by passing higher value than default at server start up.
Look @ this
 
Teresa Lee
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your quick reply. My goal is to compare each record of two tables from two different databases and intially, I got connection to the first table and for each record of the resultSet returned(266,000 records in total), I connected to the 2nd database and compare with all the records of the 2nd table. Then, I got Maximum open cursors exceeded error. So, I changed to try to use an ArrayList of bean to hold all the data from the first table and after I closed the first connection then do the comparison, then I have this heap space problem. If I don't want to change the default value for heap space and go back to my first thought, any idear of how to fix the too many open cursors problem?

Thanks for any advice.
 
Vishal Matere
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now this really becomes a database question. May be you can ask this in database forum..

Sorry ! ! !

V
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic