-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 29/05/2012 18:05, Tony Anecito wrote: > Thanks Christopher for your prompt reply! > > I am doing some performance tuning of Tomcat and wanted to > understand if the servlet was unloaded after a period of inactivity > like an EJB is. I am using a cache in the servlet and the amount of > caching is small but helpful and having the servlets say unload > every 30min would offset the use of a small cache. > > Also, FYI I just upgraded to lastest Tomcat 7 release and java > running under 64-bit 1.7.0_04 JDK and it is working fine right now. > I am using APR and had to use a 64-bit dll for that of course.
Chris is correct. Tomcat currently never unloads a pure servlet once it has been loaded. Tomcat can be configured to unload JSPs (which are compiled into Servlets) once a certain number of JSPs have been loaded but this feature is disabled by default. It is also worth noting that the Servlet spec makes it very clear that the container *may* unload servlets whenever it likes. An alternative - - that will never be reloaded - is to put it in the ServletContext as an attribute. Mark > > Regards, Tony > > --- On Tue, 5/29/12, Christopher Schultz > <ch...@christopherschultz.net> wrote: > > > From: Christopher Schultz <ch...@christopherschultz.net> Subject: > Re: For TC 7 servlets stay in memory how long? To: "Tomcat Users > List" <users@tomcat.apache.org> Date: Tuesday, May 29, 2012, 10:10 > AM > > > Tony, > > On 5/29/12 11:17 AM, Tony Anecito wrote: >> For TC 7 how long do servlets stay in memory if not invoked by a >> client or another servlet? How does one control the length of >> time? Is the there a config setting in a file somewhere? > > I don't believe Tomcat does any auto-unloading of servlets once > they are loaded. Are you in need of such a feature? Servlets > themselves should be very lightweight in terms of memory usage, > since they basically have to be stateless in order to avoid all > kinds of threading issues. > > Are you using SingleThreadedModel or anything like that? > > -chris > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJPxQMIAAoJEBDAHFovYFnnHEwP/RN0CZMFclJeKqWkXH9rbcLp qbJSLlO1fbNvRIxd8wyPuyfFpINXa3KzCLL6gOKrR6lNVy+nq9YGMd4QDrVZLuzP jnw8Fk7bTrAID8KXbBdIBcsL7iZ5w68L3fk6IF36IJWbKJdDDsC95izQPDQf4fzI /kA94L202e+0jCI+mp8IG3G/Ro7aw/rVLOSFt2z/h7tLJiXUUz98yT07YdYJqi18 X+XgmEHzkuIcopuk2Xsf8z6AQzRp9y01TvHSmBiMdBCx2hp9VZFyqLk2G5wg5eKd oylsAx7R4i44o+YD/9laB8IiLz7h0+SM1jpdt1FUHvrTfXxwCh3qhngwTE8thXYp R7KpuzB+g1gcon52RPN93fqD3vP6fD8Qkdf4fV8WoBBQ0Im+v+8pu2lkwb6SrCJE sEqv2oicaXolAr4RNJ4oHaSEn2/Zjo0O+zR9z4s8Z5LBBLpmGUrEUDzu1eRaBZuH b4fNGpDIgaJVvUmmi6wQnQvjvTG3nxTGLcK+eI2B5PXAqg/bsAmVX9mDRqiShLH3 2e0nZ9L7Y2Y6tiQv9y1VSWy46QGZWsAPRHl4+bO831Vt4t9lwmSK00pUwvMQylB2 GDS27RV1abGoXTC/59U21x7Ird6TYrGBSKxSkjd78gmYzJ3gN29SiUmFsfWNH+36 AfR+xiU01TfQl/FYXa8t =uEvQ -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org