-
Bug
-
Resolution: Fixed
-
Medium
-
7.2.12, 7.6.2, 7.6.9
-
7.02
-
55
-
Severity 2 - Major
-
277
-
-
Summary
JIRA caches different data in JiraAuthenticationContextImpl and RequestCacheController for each request in ThreadLocal. That data is cleared after each request so there is no problem there, but during large issue export that data can stay around for a long time causing high memory pressure and later high GC pressure.
Environment
- JIRA instance with 1M+ issue
Steps to Reproduce
- Access the issue navigator and search for large number of issues
- Export these issues to Excel/CSV/XML
Expected Results
Application streams the data and uses reasonable amount of memory (~100M)
Actual Results
Application caches some data for the duration of the whole request. In some case it can be 2GB+ data, which might cause OOM
Notes
Example of Dominator tree from heap dump after OOM
Objects details
- Thread ajp-nio-8009-exec-819 - 5GB
Class Name | Shallow Heap | Retained Heap | Percentage ------------------------------------------------------------------------------------------------------------------------------------------------ org.apache.tomcat.util.threads.TaskThread @ 0x132e509ba8 ajp-nio-8009-exec-819 Native Stack, Thread| 136 | 5,324,618,224 | 30.18% |- java.lang.ThreadLocal$ThreadLocalMap @ 0x136e5f3528 | 24 | 5,213,775,632 | 29.55% | '- java.lang.ThreadLocal$ThreadLocalMap$Entry[2048] @ 0x14f984b088 | 8,208 | 5,213,775,608 | 29.55% | |- java.lang.ThreadLocal$ThreadLocalMap$Entry @ 0x12b2acec98 | 32 | 2,967,537,480 | 16.82% | |- java.lang.ThreadLocal$ThreadLocalMap$Entry @ 0x12b2acec48 | 32 | 2,245,747,520 | 12.73% | |- java.lang.ThreadLocal$ThreadLocalMap$Entry @ 0x135da74120 | 32 | 83,272 | 0.00%
Note two large ThreadLocals: 2.9GB and 2.2GB
requestUrl - /sr/jira.issueviews:searchrequest-excel-all-fields/temp/SearchRequest.xls with empty queryString
Workaround
Problem is largely mitigated by the following
- limiting search results export, see
JRASERVER-63239 - Limiting Custom Field Value cache, see
JRASERVER-68806 - Addition option to limit RequestCachingGroupManager, see
JRASERVER-69733