• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session and request capacity

 
kavin clain
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any limit to save information on session and request object...
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes and no.

There is no limit. But there is a limit on the amount of memory you can use, so from that perspective there would be a limit
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Recall that a session or a request only keeps a reference to an object, it does not make a copy.

Over the life span of a request, presumably short, this make no difference.

The problem comes with a session - if the servlet container decides to serialize the session to disk, it WILL try to make a copy. Disastrous if the object is not serializable and presenting performance problems even if it is.

Bill
 
kavin clain
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the situation when the servlet container decides to serialize the session to disk?

The java based server are resource intensive... then how to allocate more memory...?

 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The servlet API lets a servlet container serialize a session to disk any time it wants to. The next time a request using the session comes in, it will deserialize back into memory.

Allocating more memory will be documented in your container docs.

Do you have a specific problem or is this just a general query?

Bill

 
kavin clain
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually the basic problem is all about limiting memory(Heap size) and affecting resources(affecting the heap).
I am concerned about my upcoming web application and resource allocation.

I have few more queries:

We save some information in session then how to handle such circumstances when session serialized on disk?
Does making objects Serializable solve this issue?

 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does making objects Serializable solve this issue?


Yes all objects bound to session / application scopes must be serializable since they can be moved across instances.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic