SessionStatistics show no Stack Traces AEM 6.5.8 | Community
Skip to main content
Level 4
August 31, 2021
Solved

SessionStatistics show no Stack Traces AEM 6.5.8

  • August 31, 2021
  • 4 replies
  • 1775 views

I noticed recently a slowdown in performance and went to check for Session leaks after almost 2 years of stability.  I noticed over 430 SessionStatistics but none have any values in the stacktrace field.  Shouldn't I be seeing the trace of what opened the Session?  What could this mean?

There are a ridiculous number of repository-reader-services and sling-scripting@sessions.

Another question, is there any side-effect if a user shared their login with 15 other people and they are all using the same user at the same time?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by joerghoh

Stacktraces are only created when the total number of sessions exceeds 1000. Enabling it by default would impose a negative performance impact on opening any session.

 

But this value can be changed with the java system parameter "oak.sessionStats.initStackTraceThreshold", and you can set it to "0", so every session gets this stacktrace information.

 

See https://github.com/apache/jackrabbit-oak/blob/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/SessionStats.java#L46 for it.

4 replies

Asutosh_Jena_
Community Advisor
Community Advisor
September 1, 2021

Hi @sdouglasmcsonova 

 

We have seen similar issue with SessionStatistics object and it was making the instance very slow. We found there were few session leaks from Resource Resolver object not being closed and we were able to take care of those. We found this issue on AEM 6.5.7.0 and then upgraded also to 6.5.9.0.

 

Thanks!

Ritesh_Mittal
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
September 1, 2021

Hi @sdouglasmcsonova ,

 

As @asutosh_jena_ mentioned its most probably because of resource resolver object not being closed. I will suggest to use try-with-resources statement, that way you will never have them opened.

Your second question is related to sharing author instance credentials among team members? I would say, even if the application/product supports it, we should NEVER share credentials with anyone otherwise it will break the whole purpose of authentication and accountability.

Cheers!

Level 4
September 1, 2021
 

Thanks guys, but that really isn't what I'm asking.  I found the issue that caused the problem (bad content, not good code to filter out bad content - created circular references). I know about closing RRs and Sessions.
My question is:Why can't I see actual stacktraces in the SessionStatistics details?  These would help show what opened the Session.

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
September 3, 2021

Stacktraces are only created when the total number of sessions exceeds 1000. Enabling it by default would impose a negative performance impact on opening any session.

 

But this value can be changed with the java system parameter "oak.sessionStats.initStackTraceThreshold", and you can set it to "0", so every session gets this stacktrace information.

 

See https://github.com/apache/jackrabbit-oak/blob/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/SessionStats.java#L46 for it.

Level 4
September 4, 2021

Beautiful, thanks for that.  I figured there would be a configurable value somewhere!