This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

OutOfMemoryError in JSP  RSS feed

 
Rakesh Gadre
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am using a customized API for fetching values from the database.
To use that API, i store each row of the ResultSet in a vector and in turn i store all such vectors in another vector.
Now, the problem is that, if the number of records are more for ex. 25000 - 30000 it gives me an error like OutOfMemoryError.
The problem is that, i cannot change code to fetch the values from the database i.e. i cannot skip vectors.
please suggest me something at the earliest.
Thanx in advance.
Rakesh
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One solution is to do a light search first, ie get the ID only, then when you have to show each list load the data for those records.
If you database supports it, you may be able to return results X to Y for a query, but the SQL isn't standard for this.
Both solutions rely on the database more, but if the other option is nothing...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!