Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HttpSession ...

 
Rajeev Ravindran
Ranch Hand
Posts: 455
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
Could anyone clear my doubts regarding HttpSession..
1) Is storing the objects in session a good process with respect to memory management.i mean, does session objects take too much memeory ??
2) pardon me if this is a dumb question
i have String Str1 which has about 3000 charactes..
and another String Str2 which has only 3 characters
im putting Str1 in one session and Str2 in another session..
Does Str1 and Str2 (size of the data it holds) play any role in memory consumed by the session ???
Thanks
Raj
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33696
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) It depends on what you put in the session. I have seen recommendations between 1K and 10K for optimal session size. You can write out a sample session to a file if you want to see how much memory it takes up (see ObjectOutputStream in the API.)
2) Yes, the bigger string will take up more memory. Everything you put in the session uses some memory. Even a field set to null will take up a byte.
 
Rajeev Ravindran
Ranch Hand
Posts: 455
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jeanne
Raj
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic