Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is there a limit to the size of object that can be kept in a session?

 
Rajesh Khan
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a limit to the size of object that can be kept in a session?
 
Paul Clapham
Sheriff
Posts: 21319
32
Eclipse IDE Firefox Browser MySQL Database
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course there isn't a rule in the servlet specification which says something like "Objects exceeding 12,839 bytes may not be stored in a session".

However from a practical point of view, if you store large objects in a session and you have a lot of users, and hence a lot of sessions, then you may be using too much memory. Of course "large" and "too much" have to be interpreted in terms of how much memory you have available to run your servlet container, and whether your sessions are shared among servers in a cluster, and various other things.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic