Open sessions - JMX | Community
Skip to main content
VeenaVikraman
Community Advisor
Community Advisor
August 3, 2018
Solved

Open sessions - JMX

  • August 3, 2018
  • 15 replies
  • 6311 views

Hi All

    I am trying to figure out the code which has a session leak. I am following Adobe's documentation.Check and analyze if JCR session leaks in your AEM instance

But I have few models where a resourceResolver is injected using

@SlingObject

    private ResourceResolver resolver;

    I can see few class reference in JMX which has these classes mentioned in the stack trace. How will we handle these resolvers? Will these be closed automatically ?

TIA

Veena

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

I just checked [1] and I haven't found a way that the ResourceTypeResolver (which seems to leak in your case) is actually leaking. It is always closed (line 665ff).

I cannot explain the fact that a lot of these session are actually open (it would be good if you could verify that by a heapdump), and that it's not a problem of the garbage collection.

[1] sling-org-apache-sling-resourceresolver/ResourceResolverControl.java at org.apache.sling.resourceresolver-1.4.8 · apache…

15 replies

VeenaVikraman
Community Advisor
Community Advisor
August 7, 2018

current prod servers are 6.2 , we will be moving to 6.4 in may be 4 months.

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
August 7, 2018

I just checked [1] and I haven't found a way that the ResourceTypeResolver (which seems to leak in your case) is actually leaking. It is always closed (line 665ff).

I cannot explain the fact that a lot of these session are actually open (it would be good if you could verify that by a heapdump), and that it's not a problem of the garbage collection.

[1] sling-org-apache-sling-resourceresolver/ResourceResolverControl.java at org.apache.sling.resourceresolver-1.4.8 · apache…

VeenaVikraman
Community Advisor
Community Advisor
September 5, 2018

There are few sessions like below (around 6k) opened in STAGE. How can I trace from where this sessions are opened ?

joerghoh
Adobe Employee
Adobe Employee
September 5, 2018

Below that (and not contained in the screenshot) there is a field "stacktrace", which should be filled with the stacktrace. This stacktraces are only created when more than 1000 sessions are opened (default), so you should check the youngest sessions, they should contain these stacks.

September 30, 2020

My AEM version is 6.5 and oak core is 1.10.8, so is it that initstacktraces will show data only if opened sessions are > 1000? Currently initstacktrace is showing empty. Where this property "oak.sessionStats.initStackTraceThreshold" can be tuned?

July 19, 2023

Same problem here. Did you manage to solve it?

VeenaVikraman
Community Advisor
Community Advisor
September 12, 2018

Thanks a lot Jorg . I was struggling to figure out those logs.

Level 9
January 2, 2023

Hi @veenavikraman  was it due to @slingObject way of injecting resource resolver?