Minimize memory usage of large javabeans
Hello,
Can I get some suggestions as to minimizing the memory usage of javabeans containing large amount of data?
I'm developing an application in which multiple session-scoped javabeans could store many rows of records retrieved from a data source. Unfortunately the data retrieved is not sorted or filtered in any way, I have to manipulate the data based on user choice myself. Worse yet, the access time to the data source could be up to 5 seconds. So retrieving data on demand is almost prohibited except for the very first time.
My question is, after getting the data and saving them to a bean, what would be the best way to preserve the data without consuming much system memory when the user goes to a different page where a different bean (of similar scenario) is invoked? Note that the users may go back and forth among these pages. I'm simply trying to balance performance and system resources while providing a decent user experience.
Is serialized javabean the answer? I'm still not clear about memory consumption and the life span of the serialized files.
Any advice would be appreciated.

