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

Lots of Data :: Out of Memory

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all Ranchers,

This is my first post in this forum. I have a big performance issue in my System. Here is the description:-
Based ion some parameters call is send to the server and then to DB, All the data is fetched in the resultset and is given to the customized Iterator Object. This data is then given to a component which can render data in the tabular format, just like the way it is in the main page of this forum.

Id Name Description Other_Information --- --- ---

and down at the bottom there is a scope of pagination just like this

1 2 3 4 5 6 7 8 9 10 next previous First Last

Now the issue is data set can go upto a million records and we are getting the whole lot of data from the DB in one go.

Secondly the framework to render data in the Tabular format, renders each cell as an object either a custom Object or String or Date etc

And most of the time we run into Java Out of Memory exception

Can you people please suggest something on this.

Is there any solution related to Caching the data

How to implement pagination in Performance effective way

Is there anything that can be done about the rendering framework something like to render data in some basic data types and not in Custom objects.


Please suggest on this ASAP

Thanks in Advance
Nishant
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Now the issue is data set can go upto a million records and we are getting the whole lot of data from the DB in one go


You can try query like below to introduce paging in DB layer.
select * from emp where empid < ?1 and rownum < 100 order by empid
You need to pass the empid of last returned row to this query.
 
Ranch Hand
Posts: 1970
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Nishant Tiwari:
This is my first post in this forum.



"Philanthropic",

Welcome to JavaRanch.

When you registered, you may not have seen that JavaRanch has a naming policy, which is mandatory and will be enforced, if necessary. You must use a real name (or at least one that sounds real) as your Display Name.

Please go to the "My Profile" link and change your Display Name to a real (sounding) name.
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This type of problem with regard to performance i had faced once.. if it contains lots of data to be fetched, see those data is coming from a single or from more tables with some comparision.here noramalisation with many tables may cause performance issues so my suggetion is try to remove the normalisation if possilble or if its a case of comparision with some other fields of other tables,the data which you are retrieving..there try to remove OR clause and use WHERE clause..this may work..
 
Rancher
Posts: 4804
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is fundamentally a "doctor doctor" problem.
The punch line is "don't do that"

So then we have to ask, what are you doing that is so slow. Without more details, I can only guess, but its usually one of two things:

One: if you are doing a nine-way join, as mohan shetty suggested, don't do that.

Two: If you are just doing a select from a single table, then it is more complicated, but realistically, no one ever wants to look at a million rows returned, so don't do that either. Change your code to pull in blocks of rows, just a few times more than the user will ever want. So if 50 fit on a page, get 100 and keep track. If only 5 fit, get 10 to 20
 
It is difficult to free fools from the chains they revere - Voltaire. tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic