-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Sreyan,

On 1/17/15 12:45 PM, sreya...@gmail.com wrote:
> I am new to Tomcat and interested in learning how to works 
> internally. I was reading the following thread on JavaRanch but it 
> did not give a concrete answer-:
> 
> http://www.coderanch.com/t/467039/Tomcat/sessions-stored

Tim Holloway answered this in the second response on "10/19/2009
5:48:56 AM".

> Does the container use an Array-List or a HashMap to store the 
> HTTPSessions?

The servlet specification does not mandate any particular storage
mechanism, so the container is free to decide what is best.

> What is the limit of the maximum sessions?

There is a very large theoretical maximum of (Integer.MAX_VALUE/2) *
Integer.MAX_VALUE because String values (session ids) are limited to
MAX_VALUE characters and characters are identified by integers. But
you'll run out of storage (or any kind) way before that.

> Are the sessions stored in RAM?

The servlet specification does not mandate any particular storage
mechanism, so the container is free to decide what is best.

In Tomcat, sessions are stored in memory (Java heap) by default. There
are other mechanisms that can persist session information to various
places. The standard manager will persist sessions to the disk during
webapp reloads, but otherwise the sessions reside exclusively in memory.

> I am aware that persistent sessions will need a
> data-store/database to the sessions. But how does it handle the non
> persistent ones ?

I encourage you to look at the source for StandardManager if you want
to really know what's going on.

> I have also consulted-: 
> http://tomcat.apache.org/tomcat-8.0-doc/config/manager.html
> 
> But this too failed to give the location of non-persistent
> sessions.

Java heap memory.

> Anyone who does Tomcat development and meddles around with the 
> source, there feedback will be highly appreciated.

Check the source code. Start with
org.apache.catalina.session.StandardManager

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJUurDmAAoJEBzwKT+lPKRYXaAQALx2GJgHjYNaj24WymwvkOoX
sf1r4e7jQJyKvAMvlDqw5nyULlnCgP+ty2Eti/zEJSadQpvFvJwq+eImtYEWONsF
Ox0Mi8wVHZgoe8sOFowUY+Jh3QlNBf+fa0y/6zszMvxmO4oajXNOwVq/tqzPlTvb
ta2LiGhj+bqcuklS45sBNG29MRXYLV4bwXm0SOSBTUhpA2f3HGvcDFJ7jSlPbChC
4xb9jObhOzdrrFAK06Wytnfebv0jp9InibT6/UoHOkv4CI7nzcwIAULYL+lhjHUx
6qrKwkQBd00F+jdzwquhREEKIIhIoPrYuEI/PlXNz2km+INIVVbQP+VqbFh0YQn8
8N5Ik8qOBPxZfAbSSFYfLHWS/2BxNQJ4KpK7bdek9G+uOMppcd6R5c+d931r9xAm
HOMor8dl087tT56kDGt0gASNxAniIuguN5pU/69xSeWC7/545IcNwfcXZSmBuzd+
ypoa0rict6SiVRxtVxfg61LjhSfCnkfbxbSSuIJsipvPB/4WLYF3PMDrRT+frQWI
zlUr3Ithy2RAUyplC4jxuK8czV+a2Kl8iCdSJW0C1lL4BKeu/C5DSNA7ajd2dmoe
T27DzHBBWqJJ3Kmy4uyRL7T8XXgh5Ut//vwKPq+JmtYesqU397CR1MPB2H+DyXGv
Ubbs7yND+vMkpozn9M9+
=bsUx
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to