Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-72438

High memory allocations when parsing update-center.json with json-lib-2.4-jenkins-3

      We experienced high memory allocations when jenkins tried to check for plugin updates. Our product showed increased allocations when parsing current 2.8MB update-center.json

      On prod instances this was about 170 GB of allocations within a minute. 

       

      I was able to reproduce it locally using IntelliJ profiler which showed about 80 GB of allocations when parsing update-center.json with the JsonTokener (https://github.com/jenkinsci/json-lib/blob/master/src/main/jdk15/net/sf/json/JSONObject.java#L829)

      culprit seems to be a null matcher which is recursively called and performs substring operations.

      https://github.com/jenkinsci/json-lib/blob/master/src/main/java/net/sf/json/util/JSONTokener.java#L117

       

      Not sure how big the impact on this is or will be, just wanted to mention it here as this drove some of our (already close to memory limit) instances OOM. 

          [JENKINS-72438] High memory allocations when parsing update-center.json with json-lib-2.4-jenkins-3

          Leon Schiesswald created issue -
          Leon Schiesswald made changes -
          Description Original: We experienced high memory allocations when jenkins is trying to check for plugin updates. Our product showed increased allocations when parsing current 2.8MB update-center.json

          !image-2023-12-19-11-07-48-046.png|width=939,height=299!

          On prod instances this was about 170 GB of allocations within a minute. 

           

          I was able to reproduce it locally using IntellIJ profiler which showed about 80 GB of allocations when parsing update-center.json with the JsonTokener ([https://github.com/jenkinsci/json-lib/blob/master/src/main/jdk15/net/sf/json/JSONObject.java#L829)]

          culprit seems to be a null matcher which is recursively called and performs substring operations.

          [https://github.com/jenkinsci/json-lib/blob/master/src/main/java/net/sf/json/util/JSONTokener.java#L117]

           

          Not sure how big the impact on this is or will be, just wanted to mention it here as this drove some of our (already close to memory limit) instances OOM. 
          New: We experienced high memory allocations when jenkins tried to check for plugin updates. Our product showed increased allocations when parsing current 2.8MB update-center.json

          !image-2023-12-19-11-07-48-046.png|width=939,height=299!

          On prod instances this was about 170 GB of allocations within a minute. 

           

          I was able to reproduce it locally using IntelliJ profiler which showed about 80 GB of allocations when parsing update-center.json with the JsonTokener ([https://github.com/jenkinsci/json-lib/blob/master/src/main/jdk15/net/sf/json/JSONObject.java#L829)]

          culprit seems to be a null matcher which is recursively called and performs substring operations.

          [https://github.com/jenkinsci/json-lib/blob/master/src/main/java/net/sf/json/util/JSONTokener.java#L117]

           

          Not sure how big the impact on this is or will be, just wanted to mention it here as this drove some of our (already close to memory limit) instances OOM. 
          Mark Waite made changes -
          Component/s Original: plugin-installation-manager-tool [ 25433 ]
          Tim Jacomb made changes -
          Assignee Original: Natasha Stopa [ stopalopa ]
          Basil Crow made changes -
          Link New: This issue duplicates JENKINS-67344 [ JENKINS-67344 ]
          Basil Crow made changes -
          Resolution New: Duplicate [ 3 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]

            Unassigned Unassigned
            leon_schiesswald Leon Schiesswald
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: