permaculture playing cards*
The moose likes Performance and the fly likes OutOfMemory with 2000 records. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Performance
Bookmark "OutOfMemory with 2000 records." Watch "OutOfMemory with 2000 records." New topic
Author

OutOfMemory with 2000 records.

Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 757
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.


Jigar Naik


Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

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.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 757
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

Joined: Apr 14, 2004
Posts: 10336

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

Joined: Jun 25, 2001
Posts: 16101
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
GeeCON Prague 2014
 
subject: OutOfMemory with 2000 records.