Details
-
Bug
-
Resolution: Fixed
-
Low
-
3.2.0, 3.3.0, 3.4.0, 3.5.0, 3.6.0, 3.7.0, 3.8.1
-
Severity 2 - Major
-
15
-
Description
Description of problem
In JIRA Service Desk, PSMQ is a component of automation and is present in versions 3.2.x and newer.
- Note: PSMQ is present but not enabled in 3.2.x.
- Enabled by default in 3.3.x and newer
PSMQ uses execution threads that are part of a thread pool and these threads are reused. A PSMQ thread may take up an excessive amount of heap due to the way threads are reused.
Experienced Behavior
PSMQ threads using excessive heap. This can cause other effects, such as an OutOfMemory error.
When viewing heap dump:
- PSMQ threads referred to as "PsmmqAsyncExecutors-job"
- Thread is retaining a large amount of heap
- Investigating the thread shows that heap is associated with ThreadLocalMap and com.atlassian.jira.issue.index.SearcherCache
Details
This problem manifests on Automation PSMQ thread pool. Since threads are being reused, they might have pretty long lifetimes, and it seems like JiraThreadLocalUtils is calling the DefaultIndexManager#flushThreadLocalSearcher method, however in SearcherCache it will reassign the variable to a new map, rather than using ThreadLocal.remove() during threads lifetimes.