• Post Reply Bookmark Topic Watch Topic
  • New Topic

determining the size of a session object  RSS feed

 
rammie singh
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi every body...

How can i determine the size of my session object..???

i searched on the google....and i got one result to use getSessionSize()

http://javawebparts.sourceforge.net/javadocs/javawebparts/session/SessionSize.html


but i am not able to use this function.
Can any body help me..??

i tried creating like this




but it is giving error.
error: Not a statement // this error is thrown when constructor SessionSize() is called i.e. at line 1

Thanks.
 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you're missing something. That reference you provided was to a javadoc page for a 3rd-party class. That class is not part of the Servlet API - you have to go get it and add it to you application. Then you can use it.

As far as how to use it once you get it, I'm sure the vendor will provide some instructions. What you have now is not valid Java, so it won't be that. Try searching for that name on the sourceforge site and see what you can find.

 
rammie singh
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yaah you are right mark. Thanks a lot.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could serialize the session to a disk file - that would give you the absolute maximum size.

Really, "session size" is frequently meaningless - suppose you have 100 current users, each of which has a reference to the same server object. The reference takes little space but if you serialize them all out you get 100 copies of the same object.

Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!