This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
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

OutOfMemory with 2000 records.

 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I have written one method, which will save the result set object in to List<Map><String,Object>

below is my method



and my query return 4 columns with 2000 records and i am getting out of memory error.

stacktrace


I wasn't expecting out of memory error with just only 2000 records.

Can anybody help me out with this issue.

after converting result set object into list i am putting it into session and then displaying it on jsp page.

 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will need to increase the heap size or decrease the number of records you cache.


after converting result set object into list i am putting it into session and then displaying it on jsp page.

So, each user on your system will have their own cached version of this list? Isn't this going to fairly dramatically reduce the number of users you can have one JVM? Why do you need to cache the results.
 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The actual result is in millions, i am just picking up 2000 records.

The result is going to be displayed on jsp page.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are not going to be able to display millions of results in a web application.

Why do the resutls need to be in the session to display them on a page?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18009
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're planning on displaying 2000 records on a single JSP, your problems are just beginning. That's way more than most of us can read onscreen without going blind, and the sheer volume of data means that updating the display will take forever.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic