I prefer to use a profiler, but I had looked into writing a class that did just that, but could not find one that would give the exact size of the session object. The easiest way to do it with regular java objects is to create one, garbage collect, record available memory, null the object, garbage collect, re-record the available memory, and then compare the difference. Since the session object is still referenced by the container you can't use this method. This is described in a javaworld article (http://www.javaworld.com/gomail.cgi?id=783152). There may be some variation on this that could do it.
Thanks, dave -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 12:42 PM To: Struts Users Mailing List Subject: RE: amount of data stored in session Along these lines, is there a simple way of determining the size of a user session at runtime? Is it as simple as a bit of code that will serialize to a temporary byte array and read the size? Has any one tried anything like this? Thanks in advance. "Dave J Dandeneau" <[EMAIL PROTECTED]> on 03/13/2002 11:37:10 AM Please respond to "Struts Users Mailing List" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> cc: Subject: RE: amount of data stored in session If you want to scale your application servers horizontally then you will need to keep your session size below about 4k. After 4k the sessions start to become to much to manage across servers and the session traffic between servers becomes a huge performance hit. dave -----Original Message----- From: keithBacon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 11:07 AM To: Struts Users Mailing List Subject: Re: amount of data stored in session Hopefully some-one has some better guidelines (not me!). Best I know is... 1 - Does anyone know how big is the session storage used internally by the server? Any thing you add is additional % that. 2 - I guess the more expensive your web-server the more efficient it's storage management would be. Ditto more expensive hardware. 3 - I'd expect these to be constantly improving. 4 - You'd have to bench mark your own configuration. 5 - If you are on Websphere on OS/390 storage should be effectively infinite & free - so no worries!! --- [EMAIL PROTECTED] wrote: > Are there published guidelines as to the number and size of objects that are > stored in the session? I've seen references to the importance of keeping > session data to a minimum, but no concrete recommendations. > > ===== ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Search the archive:- http://www.mail-archive.com/struts-user%40jakarta.apache.org/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Keith Bacon - Looking for struts work - South-East UK. phone UK 07960 011275 __________________________________________________ Do You Yahoo!? Try FREE Yahoo! Mail - the world's greatest free email! http://mail.yahoo.com/ -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

