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 fro开发者_Go百科m 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:
(source: locuslive.com) (source: locuslive.com)An explanation to shared objects can be found in the [MessAdmin documentation][1]
[1]: http://messadmin.sourceforge.net/#[[HttpSession size]]
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.
精彩评论