Expand my Community achievements bar.

SOLVED

Unclosed Oak Sessions

Avatar

Level 3

Having an issue on our production publishers with Oak sessions not being closed. This delays instance shutdown by upwards of 45 minutes at times (depending on up time, also looks to be related to amount of HTTP traffic). I am trying to find the root cause of this but haven't had any luck so far. Did a memory dump with Jmap and I see a huge amount of org.apache.jackrabbit.oak.jcr.session.* objects being retained.

I've attached some screenshots of what is going on. We are running Oak 1.0.23 with AEM6.0 SP3.

Any ideas?

1 Accepted Solution

Avatar

Correct answer by
Level 8

I would make sure that in any of your OSGI bundles (or JSP's) that wherever you use a session or resource resolver you're always closing it.

(Note the below is simply an example)

Session session = null; try { session = resourceResolver.adaptTo(Session.class); } catch(Exception e) { } finally { if (session != null && session.isLive()) { session.logout(); } }

If you're doing this correctly, or not doing anything like this at all, you may want to submit a daycare ticket.

View solution in original post

2 Replies

Avatar

Employee

It's been a while since I did this but the docs[0] point to [1] to find unclosed sessions. Might be worth trying if you haven't already.

Do you get any warnings in your error.log about unclosed sessions?

Regards,

Opkar

[0]https://docs.adobe.com/docs/en/aem/6-1/administer/operations/troubleshoot.html

[1]https://helpx.adobe.com/experience-manager/kb/AnalyzeUnclosedSessions.html

Avatar

Correct answer by
Level 8

I would make sure that in any of your OSGI bundles (or JSP's) that wherever you use a session or resource resolver you're always closing it.

(Note the below is simply an example)

Session session = null; try { session = resourceResolver.adaptTo(Session.class); } catch(Exception e) { } finally { if (session != null && session.isLive()) { session.logout(); } }

If you're doing this correctly, or not doing anything like this at all, you may want to submit a daycare ticket.