tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Save session information in Memory database
Date Fri, 09 Sep 2011 21:35:25 GMT
Hash: SHA1


On 9/9/2011 10:22 AM, Ashish Kulkarni wrote:
> What do you mean it will slow down?

Tomcat's JDBC-based session store serializes session objects in order
to save them. Serialization takes time. Ergo, using an in-memory
database will be slower than simply using plain-old memory to store

> We have an application which saves about 5 MB of data in session
> when user is working with some portion of application, so when
> about 200 users login we go about 1 GB of ram and Tomcat starts
> running out of heap memory, as all the session data goes in heap
> memory,
> So i was hoping if i can persist the data in database, then i can
> free up some heap memory from tomcat.

Er... you're asking if an in-memory database can free-up memory?

> Will this work? or tomcat will have session in Heap Memory only
> even if i prefer to persist to write it in database

If you don't want the data taking up memory on your app server, you
have two options:

1. Write to on-disk database
2. Write to remote, in-memory database

Honestly, if you're going to go to a database, you may as well make it
a durable (that is, not in-memory) one.

Some folks around here use memcached as a session-backing system. You
might want to look into doing that.

- -chris
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla -


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

View raw message