Web tier: servlets, JSP, Web frameworks: How to calculate exactly how much is big the Session object ?
- Posted by: fmarchioni fmarchioni
- Posted on: February 07 2005 09:39 EST
I'd like to know if it's possible to calculate the size of the Session object in a web application so that I can forecast how much memory my application will need for example if users will increase by a certain %
Thanks in advance
- How to calculate exactly how much is big the Session object ? by Perianayagam T on February 09 2005 01:54 EST
- How to calculate exactly how much is big the Session object ? by Perianayagam T on February 09 2005 02:00 EST
- Re: How to calculate exactly how much is big the Session object by Kevin Javia on July 04 2009 01:56 EDT
I donno you exact requirement But I guess you can use a session listener which keeps track of objects that are added to the session object. All you have to have is a counter kind of stuff that can be updated when ever an objcet is binded.
If you are able to calculate the size (m/y footprint) of each java object (is it possible !!!) then you problem is solved by using a session listener.
Or simply use getAttributeNames() method in the session interface & iterate thru each of the object binded.
There is an OpenSource utility available called MessAdmin. You can make use of this tool to get the information of your session. http://messadmin.sourceforge.net/ Hope this helps. Kevin.