Java EE - find session size

Is there a way to programmatically track the size of a specific session on a Java EE application server, or do I need to resort to tools for application developers for applications to do this?

Two scenarios:

  • Tracking from the application (a kind of interface like JMX)
  • A track from the outside (outside) is a common code that works on all application servers.
+4
source share
2 answers

There is no standard way to do this. In fact, there is really no special way to weigh an object, considering it not just primitives. One way is to serialize the object into an array of bytes and accept it as an indicator of size.

An option would be to use a profiler such as YourKit , which takes a pretty good hit when calculating the saved link size.

Maybe the provider API is for this, since most SessionManager should serialize session data for replication and storage.

+3
source

There are two approaches:

+5
source

All Articles