Status: Closed (View Workflow)
Severity 2 - Major
Atlassian Update – 13-03-2019 Hi everyone, We have recently reviewed this issue and the overall interest in the problem. We acknowledge that the issue has a high impact on the software teams and we're already working on it. We plan to include this fix in our Enterprise Releases (7.6.x and 7.13.x - please watch the fix versions for details) and latest bugfix releases. Atlassian will continue to watch this issue for further updates, so please feel free to share your thoughts in the comments. Thank you, Grażyna Kaszkur Jira Server Product Management
Class RequestCachingGroupManager may accumulate too many objects in RequestCache during processing large user sets
- Large Jira with 50k+ active users
This is one of the ways to trigger the user search
- Create 50k users
- Limit assignable permission for specific projectA for a very small subset of users
- Trigger assignable user search for projectA
- Trigger call to user/assignable/search (or user/assignable/multiProjectSearch)
- Eg: rest/api/latest/user/assignable/search?username=&projectKeys=AG&issueKey=AG-13&maxResults=50&startAt=0&_=1529917579021
Memory usage by a thread serving the request a fairly low: up to 100MB
- Memory usage by a thread serving the request a quite high: 500MB+
- If a large number of same requests are triggered at the same time, this may lead to OOM error due to exhausting of the heap.
- when Jira searches over user base and tries to findUsers according to specific criteria, it accumulates the different data (usernameToGroups, usernameToGroupNames,usernameToGroupNamesInLowerCase) in requestCache as a side-effect.
- If user search base is quite large and search criteria is too specific (too strict) than a large number of Username objects will be touched, that will lead to accumulating a large number of objects in requestCache and large memory usage by a thread.
- Note that when a thread finishes its work memory will be released, so it's not a memory leak.
- Partial workarounds (if possible):
- reduce active base
- use more specific search
The fix is not enabled by default. It will be applied only when setting the JVM argument:
Jira node restart is required.
To verify that the option was enabled correctly see if the Jira application log contains message:
The fix is about introducing the limit to number of objects stored by http request in it's cache. The default limit is 1000, but can be modified by setting JVM argument, e.g.:
The limit won't be applied if jira.cache.request.bounded.enabled is not set.