Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

OutOfMemory with 2000 records.

 
Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 763
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Saloon Keeper
Posts: 24825
172
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic