Search code examples
javajakarta-eemonitoringseam

Session size in Java EE/Seam Application


I'm running into problems with the size of my Sessions with my Web Application that is based on the Jboss Seam Framework. I am using MessAdmin to investigate and it is reporting that as soon as a User logs in, their session size jumps from 50KB to 55MB (ouch). This seems crazy as I keep very few Objects in the Conversation/Session scopes.

The output from MessAdmin makes it hard to determine the cause. I'm hoping that someone with more experience with this tool will be able to point me in the right direction.

Here's the output:

alt text
(source: locuslive.com)

alt text
(source: locuslive.com)


Solution

  • Looks simple enough: There is a handful of objects in that list with a size in excess of 50 MB, and those are the ones you need to get rid of.

    Your application objects (Task List whatever) may not be large, but if any of them contain a reference to one of those big objects, that will get pulled into your session too. You need to go over your application objects with a fine tooth comb to weed out any references to any of the objects mentioned in that printout, especially if they're not other app objects of yours. It may be feasible to mark such references (fields) as transient rather than getting rid of them outright, but I'm not sure if that will have the desired effect.

    Just to make things a little more clear: MessAdmin mentions a bunch of big objects, but some of those are probably your app objects and themselves not very big, were it not for the fact that they access something else that is not an app object and is big.