aspose file tools*
The moose likes Servlets and the fly likes how to calculate the Size of data stored in 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 » Java » Servlets
Bookmark "how to calculate the Size of data stored in session" Watch "how to calculate the Size of data stored in session" New topic
Author

how to calculate the Size of data stored in session

shaonan zhang
Greenhorn

Joined: Dec 12, 2002
Posts: 9
hi

I want to observe the amount of the session use. because An excellent performance in less session data is obtained.

I can do it by C#



But I dont know how do it by Java, (The Same Java class doesn't exist. ?)

please help me if any body know this.
i need it urgently.

thanks ina dvance,

ZSN

study hard, day day up!
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18167
    
    8

You can serialize things in Java, too. Your google keywords are "java serialization tutorial". Send your output to a ByteArrayOutputStream.

I'm not convinced that it's a useful technique for finding the memory usage of objects, but the Java concept is pretty much identical to the C# code you posted there.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Many app servers have a mechanism for determining such statistics as well, although getting aggregate data across replicated servers could be tricky (I've never tried).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to calculate the Size of data stored in session
 
Similar Threads
Symmetric key encryption and decryption using Rijndael algorithm
question Quartz with Hibernate
Java endian and bit order and signed and unsigned and python and more confusion than I can deal with
I need help with Hibernate
Transferring file name then file data over socket