Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang.OutOfMemoryError: Java heap space

 
RamandeepS Singh
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
while(rs.next())
{
String abc=rs.getString("abc1");

String abc1=rs.getString("abc2");

String abc2=rs.getString("abc3");

String abc3=rs.getString("abc4");

String abc4=rs.getString("abc5");
runcampaign=new RunCampaign(abc,abc1,abc2,abc3,abc4); // constructor of bean class called

arr.add(runcampaign);


}
} catch (Exception e) {
e.printStackTrace();
}
return arr;
}


i have to fetch 80000 records and i m using display tag in my jsp page to show records
But getting
java.lang.OutOfMemoryError: Java heap space

Please Help
Thanks in advance
Raman S
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please,use code tag to post your code
 
Rob Spoor
Sheriff
Pie
Posts: 20753
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm, where to move...

I could take JDBC because the source is JDBC code. However, I could also take JSP because that is where the results are going, and that is where any memory settings have to be changed.

Let's move to JDBC first to see if this can be solved on a database level, by perhaps using better paging or something like that.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
80,000 records is a *lot*.

DisplayTag can fetch paged results... Throwing around 80k records for even a single user isn't a great idea, will produce performance problems, and will obviously stress server memory. With multiple users it's a *really* bad idea.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic