Size, meaning memory utilization -- or disk size?
If you use session caching with JBoss Cache, the persistence mechanism stores the data on the file system.
In memory -- you would have to use some sort of profiler to see the precise sizes at this time.
I guess by size (though admittedly they may be slightly different) I mean the actual size of the session as stored in memory or on disk.
Here's a little background:
I'm helping to test an application that seems to be storing a large amount of data in the HTTP session. During the test, after a number of login/logout sequences (about 70), we start to see OutOfMemory errors. The Heap size is currently set to 512 MB. If I decrease the session timeout to a very low value (3 min.), and rerun the test, everything works fine and the memory is ok. I interpret this behavior to mean that the session size is getting large (ie. 70 sessions/450M is approx. 6.4 MB per session), and as long as I time them out before the test completes, we don't run out of memory. Since I'm not really accounting for the other processes that may be running, this is probably not a very good estimate, so I'm looking for a way to view these within JBoss to get a better estimate of the actual session size.
Look for an MBean called jboss.cache:service=TomcatClusteringCache
Different eviction strategies might be configured here.
But you might be experiencing some sort of leak anyway. You should get a memory profiler (download a trial) and take a look at what's hogging memory.