Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

SessionStatistics show no Stack Traces AEM 6.5.8

sdouglasmc
Level 4
Level 4

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?

AEM 6.5.8
1 Accepted Solution
Jörg_Hoh
Correct answer by
Employee
Employee

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/...for it.

View solution in original post

5 Replies
asutosh_jena
Community Advisor
Community Advisor

Hi @sdouglasmc 

 

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_M
Community Advisor
Community Advisor

Hi @sdouglasmc ,

 

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!

sdouglasmc
Level 4
Level 4
 

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.

Jörg_Hoh
Correct answer by
Employee
Employee

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/...for it.

View solution in original post

sdouglasmc
Level 4
Level 4

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