You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Robert Palmer <ro...@greetin.gs> on 2006/01/14 17:58:01 UTC

Size of session bean

When calculating the size of a session bean to determine memory usage, 
what should be included and how is this done? Do the number of methods 
matter? The size of the code? Just the variables? I've read much about 
limiting the size of the session information but not how to do it. I 
have some fairly large classes in session context but they don't store 
very much.

Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Size of session bean

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
That's an interesting question... looking at the code I wrote in Java 
Web Parts for the getSessionSize() method, I'm only taking into 
consideration the fields of the objects in session.  I think this is OK 
because IIRC, when an object is serialized, only the non-transient 
values are considered.  The methods don't factor into it because you 
aren't serializing the class definition, just the state of the object. 
If anyone knows differently I'd like to hear about it, but I believe how 
that method works yields an accurate result.

If you want to see how I've done it, check out:

http://javawebparts.sourceforge.net

If you look at the javadocs, in the session package, there is a class 
called SessionSize that is used to get the size of a session object. 
You can grab the code and see how it's done, or just use it if that's 
your ultimate goal :)

Frank

Robert Palmer wrote:
> When calculating the size of a session bean to determine memory usage, 
> what should be included and how is this done? Do the number of methods 
> matter? The size of the code? Just the variables? I've read much about 
> limiting the size of the session information but not how to do it. I 
> have some fairly large classes in session context but they don't store 
> very much.
> 
> Thanks.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 
> 

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org