Skip to main content
VeenaVikraman
Community Advisor
Community Advisor
Aug 3, 2018 10:44 AM UTC
Solved

Open sessions - JMX

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.
joerghoh
joerghohAccepted solution
Adobe Employee
Aug 7, 2018 8:54 PM UTC

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…

18 replies

VeenaVikraman
Community Advisor
Community Advisor
Aug 7, 2018 10:14 AM UTC

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

Translate
joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
Aug 7, 2018 8:54 PM UTC

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…

Translate
VeenaVikraman
Community Advisor
Community Advisor
Sep 5, 2018 11:51 AM UTC

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

Translate
joerghoh
Adobe Employee
Adobe Employee
Sep 5, 2018 11:57 AM UTC

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.

Translate
Sep 30, 2020 5:25 AM UTC

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?

Translate
Jul 19, 2023 10:18 AM UTC

Same problem here. Did you manage to solve it?

Translate
VeenaVikraman
Community Advisor
Community Advisor
Sep 12, 2018 11:06 AM UTC

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

Translate
Level 9
Jan 2, 2023 3:26 AM UTC

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

Translate