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

Memory leak in ThreadLocalCache

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.3.14.Final, 2.2.33.Final
    • None
    • None
    • None

      If we set keepAliveTime to ThreadPoolExecutor, the thread will be terminated periodically and a new one will be created.
      In Java's ThreadLocal, when the Thread terminates, the object becomes the target of gc.
      However, ThreadLocalCache holds a reference to the Thread even if the Thread terminates. Additionally, the ByteBuffer in ThreadLocalData corresponding to the value of the Map<Thread, ThreadLocalData> also remains referenced and is not target to gc.

      So, we have to remove Thread key when the thread terminated.

              flaviarnn Flavia Rainone
              skyblue300a BEOMJUN KIM (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: