Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-27063

[GSS](8.0.z) UNDERTOW-2389/2385 - DefaultByteBufferPool leaks buffers for released threads

XMLWordPrintable

    • False
    • None
    • False
    • Low
    • ?
    • Workaround Exists
    • Hide

      Configure the task thread pool with core equal to max to avoid idle thread releases:

      <subsystem xmlns="urn:jboss:domain:io:3.0">
              <worker name="default" task-core-threads="192" task-max-threads="192"/>
              <buffer-pool name="default"/>
          </subsystem>
      
      Show
      Configure the task thread pool with core equal to max to avoid idle thread releases: <subsystem xmlns= "urn:jboss:domain:io:3.0" > <worker name= " default " task-core-threads= "192" task-max-threads= "192" /> <buffer-pool name= " default " /> </subsystem>
    • Hide

      See README in undertow2389reproducer.zip

      Show
      See README in undertow2389reproducer.zip

      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
      ---------------------------------------------------------------------------------------------------------------------------------------------------------------
      

        1. java_pid503681.0002.7z
          39.64 MB
          Aaron Ogburn

              flaviarnn Flavia Rainone
              rhn-support-aogburn Aaron Ogburn
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: