[EMAIL PROTECTED] wrote: > PROPOSAL: When Session Max reached, throw out oldest session > > Currently tomcat ships with the maximum number of sessions set to > unlimited. They can expire by default after 30 minutes, however if > too many sessions are created within the 30 minutes, you can run out > of memory. > > To prevent running out of memory, you might choose to limit the > allowed number of active sessions. If you use the default > StanardManager (session manager) you can set the "maxActiveSessions" > to effect a limit. However if you exceed the number of allowed > sessions, a RuntimeException (IllegalStateException) is thrown. > > I propose two changes to reduce seeing these (IllegalStateException or > OutOfMemory) exceptions for sessions; > > 1. When the maximum number of sessions is reached, change > StandardManager from throwing an IllegalStateException exception, to > expiring the Least Recently Used (LRUMap) session.
The session manager definitely needs to go through a refactoring, and this is a good start. This behavior seems better to me, esp since it is possible to disable it (by setting maxActiveSessions to "-1"). > 2. Instead of defaulting to an unlimited number of sessions (and > getting visits from OutOfMemory), limit the number of sessions to > 10000 by default. Going with an upper bound seems better for reliability in the default configuration. +1. Remy -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>