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.
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?
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?