Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-63338

Edit/create/transition issue REST endpoint is loading into memory all values for fields visible on the screen

    XMLWordPrintable

Details

    Description

      PUT /rest/api/2/issue/{issueIdOrKey} method is loading all possible fields ids with all values into memory.

      In particular this endpoint loads all possible versions for each version field creating thousands of VersionBean.

      This data is completely not needed in this resource.

      Effects

      1. Loading all this data consumes a lot of memory for 64k versions this is taking up to 100MB of RAM.
      2. Creating REST beans for all those values is slow and as an effect editing issues trough REST is slow. 

       

      This bug is essentially in IssueInputParametersAssembler class in 

      private Set<String> getValidFieldsForEdit(Issue issue) { EditMetaFieldBeanBuilder builder = new EditMetaFieldBeanBuilder(fieldLayoutManager, issue.getProjectObject(), issue, issue.getIssueType(), jiraAuthenticationContext.getLoggedInUser(), versionBeanFactory, velocityRequestContextFactory, contextUriInfo, baseUrls, fieldScreenRendererFactory, fieldManager, issueManager); Set<String> strings = new HashSet<>(); strings.add(IssueFieldConstants.COMMENT); strings.addAll(builder.build().keySet()); return strings; }

      We get only keys from EditMetaFieldBeanBuilder

      builder.build().keySet()

      We should instead add method

      builder.buildKeys()

      WORKAROUND

      Remove the field that has many values from appropriate screen. 

      Attachments

        Issue Links

          Activity

            People

              ajakubowski Adam Jakubowski (Inactive)
              ajakubowski Adam Jakubowski (Inactive)
              Votes:
              7 Vote for this issue
              Watchers:
              16 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: