Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-99864

Confluence can encounter OOM issue intermittently due to Hibernate L2 cache i.e com.hazelcast.hibernate.local.LocalRegionCache

XMLWordPrintable

      Issue Summary

      Confluence can encounter OOM issue intermittently due to Hibernate L2 cache i.e com.hazelcast.hibernate.local.LocalRegionCache

      Steps to Reproduce

      1. Setup Confluence cluster environment with example site.
      2. As part of dashboard, add few macros such as Recently updated, Blogpost etc.
      3. Create about 10 different spaces with some content( or copy the content from example dashboard page including child)
      4. Create about 10 different users and then try to login using these users.
        With these steps, you wont see any difference but as part of JVM heap usage, we now have cached the query(around space view permissions) and results for these 10 users. This can be verified from the heap dump.
        Now let's consider the same case for an environment where we have about more than 3K users logging in across a day and we have more than 30k spaces across the environment. Since the data set(space results) that we are caching is huge and so for each user, we end up with using about (1-8MB) of heap space. Considering that we have about 3K users logging in, this means that we need at least around (3GB to 24GB) of memory to cater to this result set alone and this can vary further, if we have more users logging in for a specific day. Based on heap size configured, this can surely impact Confluence workflows and can cause OOM issues

      Expected Results

      Confluence should make optimum use of L2 cache so as not to cause OOM issues.

      Actual Results

      Confluence encounters OOM issue due to really large data set occupied under L2 cache which is linked to View Space Permission query -

      select distinct space0_.SPACEKEY as col_0_0_, case when denormalis1_.SPACE_ID is null then 0 else 1 end as col_1_0_ from SPACES space0_ left outer join DENORMALISED_SPACE_VIEW_PERMISSIONS denormalis1_ on (space0_.SPACEID=denormalis1_.SPACE_ID and (SID_ID in (? , ? , ? , ?)))
      

      The below exception is thrown in the catalina.out file:

      java.lang.OutOfMemoryError: Java heap space
      

      Workaround

      • Increase configured heap size to larger size so as to accommodate these results if the issue being encountered is really less frequent. Increased heap size will help provide some more resilience around it. FYIP, this does not guarantee that this cannot be encountered again.
        OR
      • Disable faster permissions only under the scenario where this is happening too frequently so as to bring stability to the environment. There is a possibility that this may impact Confluence, so use this with caution.

              5339cdd01cf4 Jeffery Xie
              02495d088b9f Saurabh Bhatia
              Votes:
              21 Vote for this issue
              Watchers:
              31 Start watching this issue

                Created:
                Updated:
                Resolved: