How about keeping track of how many of these big operations are
running (using a synchronized counter) and returning a 503 status for
"big" requests that come in when the system is busy? Only the
servlet(s) or page(s) that handle these big requests would be limited,
the rest of the webapp would keep handling requests as normal.
-- 
Len

On 7/31/07, Craig Berry <[EMAIL PROTECTED]> wrote:
> The trouble is that our memory demand per user session is unpredictable.
> Some user sessions do things that barely touch the heap; other sessions
> can make huge demands.  It depends on what the user chooses to do during
> the session.  So throttling user count down to make it utterly safe
> would be impractical.  Instead, statistically, it's unlikely that more
> than one or two memory-hungry sessions will be active at any given time.
> When we get more than that at once, we risk an OOME.
>
> -----Original Message-----
> From: Andrew Miehs [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 31, 2007 10:01 AM
> To: Tomcat Users List
> Subject: Re: Recovery from OutOfMemoryError?
>
> On 31/07/2007, at 6:52 PM, Craig Berry wrote:
>
> > Fixing the bug would be cool, but the "bug" is actually just too many
> > users contending for the same heap space, so that's going to be tough.
> > I'd thought of the log watcher, but that seems a rather blunt
> > instrument; I was thinking there might be some kind of Tomcat (or JVM)
> > intrinsic mechanism for this.
>
> How much heap space do you have set?! Why don't you just increase it?
>
> If not, why not decrease the number of users you allow onto the server?
>
> Restarting Tomcat is even more 'blunt' then allowing access to
> fewer users...
>
> Confused...
>
> Andrew
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to