Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-2309

Possible memory leak in DefaultByteBufferPool

XMLWordPrintable

      Couple of memory leaks were reported by QE, which manifest when reloading the app container (JBEAP-25588). This ticket is about the Undertow related class instances.

      Following class instances are created at each app server reload, but are never garbage collected:

      |          386752 bytes (+1344)|          6043 instances (+21)|io.undertow.server.DefaultByteBufferPool
      |           142104 bytes (+504)|          5921 instances (+21)|io.undertow.server.DefaultByteBufferPool$ThreadLocalData
      

      DefaultByteBufferPool defines a non-static ThreadLocal<ThreadLocalData> threadLocalCache field.

      The threads where ThreadLocalData instances are stored into the threadLocalCache fields are the "MSC service threads". These threads survive the server reloads.

      To me it looks that the reason why above instances are not garbage collected is that the ThreadLocalData instance references are kept in the Thread.threadLocals map of the MSC service threads (i.e. the map where ThreadLocal values are stored).

              flaviarnn Flavia Rainone
              thofman Tomas Hofman
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: