aspose file tools*
The moose likes Websphere and the fly likes calculate the size of the session Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "calculate the size of the session" Watch "calculate the size of the session" New topic
Author

calculate the size of the session

Irene Loos
Ranch Hand

Joined: Apr 15, 2002
Posts: 78
Does anyone know how one can calculate the size of particular application session in WebSphere 5.0.1 with multiple applications running on the same server? After I moved new version of the jar to the server the session size grow 10%, even though there were only 2 simple changes to the code that should not create that big of a difference.

Also, is there any way to calculate the size of the session when you are running WSAD?


Thank you,
Irene


Irene Loos
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29274
    
140

Irene,
You could use a profiling tool (WSAD has one built in) to see the approximate size of the session. If you want the exact size, you could serialize/output the session to an in memory writer and get the number of bytes from it. Or if you are using session persistence, you could see the size of the row in the database.

It sounds like you may already have a method if you know the size is jumping by 10%. If I had to guess, I would say that one of the objects now has a reference to some other object. Sessions are transitive when persisted somewhere.

Also note that this size can be misleading. If all of your sessions have a reference to the same object, it is only in memory once but will be in all the calculated session sizes.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24168
    
  30

This has nothing to do with Performance, and everything to do with WebSphere, so let's move this to the WebSphere forum.


[Jess in Action][AskingGoodQuestions]
Irene Loos
Ranch Hand

Joined: Apr 15, 2002
Posts: 78
Hello Jeanne,
Thank you for your post. I am not familiar with a profiling tool in WSAD much. I set it up but it does not provide with the size of the session. It gives information about how much references different classes have, etc. Could you please tell me more how to set up it correctly?

I know that the session size jumped 10% on the server where multiple applications are deployed after new version of our jar was deployed. But it could be related to other issues as well. We cannot distinguish session size per application. Any other suggestions?

Thank you,
Irene
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29274
    
140

Irene,
I don't recall the details on the profiler. You can check in the WSAD help or a redbook for more information.

Personally, I used the approach of Serializing the session object because I wanted to get the exact size.
Irene Loos
Ranch Hand

Joined: Apr 15, 2002
Posts: 78
Thank you for advise.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: calculate the size of the session
 
Similar Threads
size of objects in session
Session size...
Finding formula?
image height&width needed
Calculate the average of an ArrayList