Win a copy of Murach's Python Programming this week in the Jython/Python 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...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!