• Post Reply Bookmark Topic Watch Topic
  • New Topic

size of session  RSS feed

 
ramjcp kris
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i was adding so many objects to my session.is there any way where i can find the size of session and as well as session objects,please give me sample code
 
Ola Daniel
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


This will give you a list of everything in session ...
 
Neeraj Dheer
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you do know that all that the 'session' actually stores are the references to all the objects stored in it and not the actual objects?
 
ramjcp kris
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Daniel.

thanks for u code, I know how to get the session objects.
but my doubt is how to find the size of a session object.
while adding object to a session ,session contains reference to that particular object,then how can i get its size
 
ramjcp kris
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes Neeraj ,i agree with you,my doubt is finding the size of session along with objects and also the size of particular session object.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a tool in Java Web Parts that can do this.

Bear in mind the implications of what Neeraj has said.
A session is just a map of references to objects living on the heap.
Multiple sessions can hold references to the same object. This means that the actual memory footprint of all your sessions will actually be smaller than the size of all of your serialized sessions.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!