struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hoang, Hai" <>
Subject RE: Session Cleanup
Date Thu, 17 Oct 2002 20:49:39 GMT
I often stored my form beans in a session scope.  I've a routine that
looping through the session and destroy the unused forms.  The tricky part
is how to determine with forms are no longer in used.

Anyone out there using this technique?

-----Original Message-----
From: Craig R. McClanahan [] 
Sent: Thursday, October 17, 2002 3:37 PM
To: Struts Users Mailing List
Subject: Re: Session Cleanup

On Thu, 17 Oct 2002, atta ur-rehman wrote:

> Date: Thu, 17 Oct 2002 13:36:41 -0700
> From: atta ur-rehman <>
> Reply-To: Struts Users Mailing List <>
> To: Struts Users Mailing List <>
> Subject: Re: Session Cleanup
> Thanks, David. Putting commonly used collection in the application scope
> a nice idea; both for storage space and performance reasons.
> Now how do I store my form beans in request instead of session? Is it the
> "scope" attribute of the action mapping that determines it?


> And what are
> performance implications of this change?

The set of attributes in the request or session object supplied by the
servlet container is usually a HashMap, so performance of storing the form
bean in either is equivalent.  However, your app will benefit from the
fact that the form bean is automatically released at the end of the
request, so the overall memory occupancy of your app will likely be lower,
but the CPU time consumption might be higher (due to increased garbage

For most apps, this tradeoff is very much worth it because having excess
CPU capacity is more common than having excess memory to store the form
beans in session scope in between requests.

> Regards,


To unsubscribe, e-mail:
For additional commands, e-mail:

Introducing the all new and improved  With a totally new 
personalized design, it's the best place to go. Before you go.

Continental Airlines. Work Hard. Fly Right.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message