This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Storing large data in session

 
jayram
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
My application needs to cache a large amount of data. I can do it at application scope or at session scope in JSP.But i think it will degrade performance as it might consume lot of RAM. This data is as good as static and i dont want to go back to database to get same data.
Please suggest me alternative ways of doing same thing.
Cheers
Jayram
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this data serializable? If so you might keep a weak reference to it, that way the GC could remove it if necessary. See the java.lang.ref package.
Bill
 
Terence Doyle
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,
Why not write it out to a temp file that is destroyed on session close?
I'm not sure what the performance issues are about writing but for the reading you could then use a BufferedReader.
Comments anyone?
------------------
Terry Doyle
Sun Certified Programmer for Java 2 Platform
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic