user3383358
user3383358

Reputation: 57

Large catalogs, to JSp page is causing OutOfMemoryErrors

 Catalog catalogs= product.getAllCatalog();

 request.setAttribute("catalogs",catalogs); 
  ..
 ...
...

so when i am dispatching request to the JSP page with large no of catalogs size it causing OutOfMemoryErrors .

can some one tell me how to fixed this problem ,any way to fixed this problem.

Upvotes: 0

Views: 35

Answers (3)

loknath
loknath

Reputation: 1372

Pagination can solve you problem .and in each iteration i.e when moving to next page clear your 1 level cache it can solve your problem .

For more infomation about how to implement pagination with example click here

Upvotes: 1

Scary Wombat
Scary Wombat

Reputation: 44854

try to use pagination or create a collection of beans that only hold the data that you really need

For example if you only display field1, field2 and field3 or your Catalog then create a bean with only these fields

Upvotes: 1

Jigar Joshi
Jigar Joshi

Reputation: 240928

Pagination is the way to go, don't load everything at once and load only required fields from Catalog

Upvotes: 1

Related Questions