Uploaded image for project: 'GateIn Portal'
  1. GateIn Portal
  2. GTNPORTAL-852

Memory leak caused by uncleaned JCR sessions in some HTTP requests


    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.0.0-GA
    • Component/s: Performance
    • Labels:


      In some HTTP requests sent to GateIn portal can be seen situation, where method class org.exoplatform.services.jcr.impl.core.SessionRegistry.registerSession(SessionImpl session) is called 2-times but method unregisterSession of same class is called only one time in particular HTTP request. So only second used JCR session is unregistered but the first session remains in private map "sessionsMap". So final result is, that there is one new item in sessionsMap for special HTTP request.

      I founded that these HTTP requests can cause problems:

      • HTTP request used to login any user into GateIn portal (triggered by click to "Sign in" button)
      • HTTP request to show dashboard of user root ( http://localhost:8080/portal/private/classic/Tab_0 )
        At least these two types of HTTP request can be used to simulate the issue.

      I founded the possible cause of problem in class org.exoplatform.commons.chromattic.Synchronization in method loggedIn:

      public void loggedIn(Session session)

      { repositorySessions.put(session.getWorkspace().getName(), session); }

      If this method is called 2-times during single HTTP request, than new session simply rewrite old session (if workspace name is "portal-system" in both cases). So in RequestLifeCycle.end is cleared only the last session.

      Another thing is, that org.exoplatform.services.jcr.impl.core.SessionRegistry can use helper thread called "SessionCleaner" which can clean timeouted JCR sessions. But SessionCleaner is actually unused (timeout is configured with value 0 in sessionRegistry)

        Gliffy Diagrams




              • Assignee:
                mposolda Marek Posolda
              • Votes:
                0 Vote for this issue
                0 Start watching this issue


                • Created: