Uploaded image for project: 'AMQ Broker'
  1. AMQ Broker
  2. ENTMQBR-2292

High Per-Thread Memory Usage by Netty / XNIO

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Major Major
    • None
    • AMQ 7.2.0.GA
    • broker-core
    • None

      Artemis broker-client-threads and others seem to maintain large (16mb) buffer caches at the thread-local level. This seems to be as-designed, but results in large amounts of memory usage in environments with lots of threading.

      Class Name                                                                      | Ref. Objects | Shallow Heap | Ref. Shallow Heap | Retained Heap
      --------------------------------------------------------------------------------------------------------------------------------------------------
      java.lang.Thread @ 0x60a96f750  default task-223 Thread                         |            1 |          120 |                88 |        16,304
      '- threadLocals java.lang.ThreadLocal$ThreadLocalMap @ 0x60a995250              |            1 |           24 |                88 |        15,928
         '- table java.lang.ThreadLocal$ThreadLocalMap$Entry[128] @ 0x73cca9e90       |            1 |          528 |                88 |        15,904
            '- [15] java.lang.ThreadLocal$ThreadLocalMap$Entry @ 0x6050d4418          |            1 |           32 |                88 |         1,280
               '- value io.netty.util.internal.InternalThreadLocalMap @ 0x6050d4438   |            1 |          136 |                88 |         1,248
                  '- indexedVariables java.lang.Object[32] @ 0x6050d44c0              |            1 |          144 |                88 |         1,112
                     '- [1] io.netty.buffer.PoolThreadCache @ 0x600258408             |            1 |           72 |                88 |       195,832
                        '- heapArena io.netty.buffer.PoolArena$HeapArena @ 0x5e8fc3398|            1 |          144 |                88 |         2,760
                           '- qInit io.netty.buffer.PoolChunkList @ 0x5e8fc3ea0       |            1 |           40 |                88 |            40
                              '- head io.netty.buffer.PoolChunk @ 0x60dc7e098         |            1 |           88 |                88 |    16,795,048
      --------------------------------------------------------------------------------------------------------------------------------------------------
      

      This behavior was observed in the embedded broker in JBoss EAP. There do seem to be some global / JVM flags available for tuning netty caching behavior, but the ramifications of adjusting these settings globally is unknown. Are there any settings for tuning this usage at the broker level?

            rhn-support-dhawkins Duane Hawkins
            rhn-support-dhawkins Duane Hawkins
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: