1

I made a JVM heap dump of my tomcat server with jmap, and I'd like to figure out what is the size of all the sessions in memory.

As such I would like to know what type of object I should be looking for to estimate the sessions size.

Thank you

Matthieu Napoli
  • 48,448
  • 45
  • 173
  • 261

3 Answers3

4

It's a javax.servlet.http.HttpSession and the javadoc for it is here. Note that it's an interface, but there's a tomcat interface that extends it org.apache.catalina.Session. I would look for all the classes that implement the Catalina Session interface; org.apache.catalina.cluster.session.DeltaSession, org.apache.catalina.cluster.session.ReplicatedSession, and org.apache.catalina.session.StandardSession.

I'm sure there are a few confounding variables which might make session tracking not 100% correlate to memory usage, but at least it's a start.

Edwin Buck
  • 69,361
  • 7
  • 100
  • 138
  • +1: Not sure I like the wording on this (specifically calling them subclasses instead of implementing classes), but you mention the same classes I was going to point out. – Powerlord Apr 22 '11 at 14:29
  • Yes ! Worked with `org.apache.catalina.session.StandardSession`, thanks (for now I guess my server don't use the other types of sessions) – Matthieu Napoli Apr 22 '11 at 14:30
  • 1
    @R. Bemrose, yes, I've fixed the wording (and added fully qualified class names, and included more links back to Tomcat 5.5 documentation). Sorry for the odd wording, but it's part of my write / read / edit / rewrite life-cycle. – Edwin Buck Apr 22 '11 at 14:32
  • @Matthieu, I am sure that 95% of us use the `StandardSession` exclusively, but the others were right there in the javadoc, so I included them (just in case). – Edwin Buck Apr 22 '11 at 14:33
0

org.apache.catalina.session.StandardSession, gave me an idea about tomcat sessions, when analyzing a heapdump.

Denuwanthi
  • 44
  • 1
  • 5
0

javax.servlet.http.HttpSession

Keith
  • 2,958
  • 4
  • 26
  • 29