• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Out of Memory Exception in Websphere

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
We have a peculiar problem while running a Search Service.
The different components involved are given below:
Struts Controller-> JSP Page -> EJB Stateless Session Bean -> Java Class (DAO)-> Database.
When a user clicks on the 'Search' button, the Search needs to fetch 10,000 records at a time. The request is serviced in the above manner and the resultset is displayed through a JSP Screen. Pagination Logic is built in the query so that it retrieves a partial resultset (ie first 10,000, next 10,000 etc)
However when the user clicks on the 'Next' Button, on the result screen, an Out of Memory Exception is thrown by the Bean. The Heap size is set to maximum. Note there is no SQL Exception occuring, the error occurs when the EJB has to send the resultset to the jsp.
Any Ideas as to why this happens?
 
Ranch Hand
Posts: 128
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Poornima,
This could be happenning if there is an recursive loop in your logic somewhere...or if there is any cyclic reference between two objects check that. otherwise I dont see any problem...
you dont need to start to fetch the next 10,000 immediately till the traversal of the first 10,000 records are over, and more over may be you need to GC the first 10000 records to fetch the new ones...??
 
poornima karanth
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Rajanikanth,
We did a code check for memory leaks in the code. And found the following.
The Data in each column is huge, (the biggest one is around 500 chars in a column). So while setting the data for this column in every record, the functionality required replacing a particular character by another before display. This was being done in the DAO before populating the ArrayList Object.
We pushed this code to the Query (using Replace function) & now it works fine.
 
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic