Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to calculate the Size of data stored in session

 
shaonan zhang
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Paul Clapham
Sheriff
Pie
Posts: 20958
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic