Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-25288

Memory leak of io.opentracing.util.ThreadLocalScope

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Affects Version/s: 7.12.8, 7.16.3
    • Fix Version/s: 7.18.0
    • Component/s: None
    • Labels:
      None
    • Severity:
      Critical
    • Regression:
      Yes
    • Release Notes:
      Yes

      Description

      We have observed a memory leak with Artifactory.
      After closely monitoring the system we have determined that the leaking object is io.opentracing.util.ThreadLocalScope.

      In the sample output below of a class histogram, you can see such objects consuming 2.6gb of memory:

       num     #instances         #bytes  class name (module)
      -------------------------------------------------------
         1:     125513329    13570570800  [B (java.base@11.0.8)
         2:      34683297     8292099312  [Ljava.lang.Object; (java.base@11.0.8)
         3:       2728084     7281749848  [Ljava.util.HashMap$Node; (java.base@11.0.8)
         4:      10811131     3284377328  [I (java.base@11.0.8)
         5:      84977886     2719292352  java.lang.String (java.base@11.0.8)
         6:      65714535     2628581400  io.opentracing.util.ThreadLocalScope
      

      To reproduce:
      Simply run a script such as below while monitoring the number of objects in memory (either with a Java profiler or by taking histograms)

      #!/bin/bash
      for i in {1..1000000}
      do
         curl -uadmin:password  -XPUT http://localhost:8082/artifactory/example-repo-local/file$i
      done
      

      Inspect that the number of objects of "io.opentracing.util.ThreadLocalScope" is growing by exactly 1 for each upload.
      Invoke Java GC, confirm those objects are not being GCed.

        Attachments

          Activity

              People

              Assignee:
              tomern Tomer Nir
              Reporter:
              arielk Ariel Kabov
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Sync Status

                  Connection: RTFACT Sync
                  RTMID-25288 -
                  SYNCHRONIZED
                  • Last Sync Date: