-
Bug
-
Resolution: Duplicate
-
Critical
-
2.2.30.Final, 2.3.11.Final
-
None
Due to UNDERTOW-2309, DefaultByteBufferPool can now leak buffers over time as threads are released (such as idle threads above task-core-threads being released and recreated with load oscillations over time).
Before UNDERTOW-2309, the ThreadLocalData buffers were stored directly on the Thread via the standard java ThreadLocals so if the Thread died, the ThreadLocalData was inherently released from the Thread's own local map. But now if a thread dies, it is not ever released from the io.undertow.server.DefaultByteBufferPool$ThreadLocalCache's localsByThread map. So a heap dump shows the entries piling up here:
Class Name | Ref. Objects | Shallow Heap | Ref. Shallow Heap | Retained Heap --------------------------------------------------------------------------------------------------------------------------------------------------------------- [56] class io.undertow.protocols.ssl.UndertowXnioSsl @ 0xaf1b2a10 | 71,676 | 8 | 1,720,224 | 32 '- DEFAULT_BUFFER_POOL io.undertow.server.DefaultByteBufferPool @ 0xaf1b2a80 | 71,676 | 64 | 1,720,224 | 20,792,448 '- threadLocalCache io.undertow.server.DefaultByteBufferPool$ThreadLocalCache @ 0xaf1b2ac0| 71,676 | 16 | 1,720,224 | 18,071,056 '- localsByThread java.util.HashMap @ 0xaf1b2ad0 | 71,676 | 48 | 1,720,224 | 18,071,040 '- table java.util.HashMap$Node[131072] @ 0xb3c67d20 | 71,676 | 524,304 | 1,720,224 | 18,070,992 |- [108494] java.util.HashMap$Node @ 0xb1610fb0 | 6 | 32 | 144 | 1,488 | |- next java.util.HashMap$Node @ 0xb1def998 | 5 | 32 | 120 | 1,240 | |- value io.undertow.server.DefaultByteBufferPool$ThreadLocalData @ 0xb15d5e98| 1 | 24 | 24 | 128 ---------------------------------------------------------------------------------------------------------------------------------------------------------------
- duplicates
-
UNDERTOW-2385 Memory leak in ThreadLocalCache
- Resolved
- is caused by
-
UNDERTOW-2309 Possible memory leak in DefaultByteBufferPool
- Closed
- is cloned by
-
JBEAP-27062 [GSS](7.4.z) UNDERTOW-2389/UNDERTOW-2385 - DefaultByteBufferPool leaks buffers for released threads
- Closed
- is incorporated by
-
WFCORE-6862 CVE-2024-6162 CVE-2024-27316 Upgrade Undertow to 2.3.14.Final
- Resolved
- is related to
-
JBEAP-27063 [GSS](8.0.z) UNDERTOW-2389/2385 - DefaultByteBufferPool leaks buffers for released threads
- Closed
- links to