aspose file tools*
The moose likes Java in General and the fly likes Size of a session object 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 » Java » Java in General
Bookmark "Size of a session object" Watch "Size of a session object" New topic
Author

Size of a session object

Marilyn Monickam
Ranch Hand

Joined: Jun 05, 2001
Posts: 66
Hi
Could you let me know if there is a way to determine the size of a session object or any object?
Thanks
Marilyn
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2771
    
  10

There's no sizeof operator like in C, if that's what you mean. Java tries to abstract you from the idea of the physical memory. However, if you use a profiler like OptimizeIt, you can get some idea of how many objects of each type have been allocated, and how much memory they take.
On the other hand, if you meant how to get a count of the attributes currently contained in a session (and you're talking about an HttpSession), I don't see an obvious way. You have to getAttributeNames(), then cycle through the Enumeration to count them.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Size of a session object
 
Similar Threads
Problem in Select query
maximum size of the session object
size of session
Size limit of the Request
Is there a limit to the size of object that can be kept in a session?