• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calculate the size of the session

 
Irene Loos
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34198
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This has nothing to do with Performance, and everything to do with WebSphere, so let's move this to the WebSphere forum.
 
Irene Loos
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Marshal
Posts: 34198
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for advise.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic