Large DirectByteBuffer overhead in Util$BufferCache

Solution Unverified - Updated -

Issue

  • We see "OutOfMemoryError: Direct buffer memory" errors. The heap dump shows many DirectByteBuffer stored as thread locals by sun.nio.ch.Util$BufferCache:
'- threadLocals java.lang.ThreadLocal$ThreadLocalMap @ 0x52df9aa38       |            1 |           24 |                64 |        41,024
   '- table java.lang.ThreadLocal$ThreadLocalMap$Entry[256] @ 0x51ce090f0|            1 |        1,040 |                64 |        41,000
      '- [184] java.lang.ThreadLocal$ThreadLocalMap$Entry @ 0x52dfc7ef8  |            1 |           32 |                64 |         4,168
         '- value sun.nio.ch.Util$BufferCache @ 0x52dfc7f18              |            1 |           24 |                64 |         4,136
            '- buffers java.nio.ByteBuffer[1024] @ 0x52dfcc510           |            1 |        4,112 |                64 |         4,112
               '- [489] java.nio.DirectByteBuffer @ 0x565d5bb48          |            1 |           64 |                64 |            64

Environment

  • Java
  • JBoss Enterprise Application Platform (EAP)

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.