Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-12507

java.lang.OutOfMemoryError: Direct buffer memory

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • core
    • None

    Description

      Hi, we have three brokers in our kafka cluster, and we use scripts to send data to kafka at a rate of about 3.6w eps. After about one month, we got the OOM error: 

      [2021-01-09 17:12:24,750] ERROR Processor got uncaught exception. (kafka.network.Processor)
      java.lang.OutOfMemoryError: Direct buffer memory
          at java.nio.Bits.reserveMemory(Bits.java:694)
          at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:123)
          at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:311)
          at sun.nio.ch.Util.getTemporaryDirectBuffer(Util.java:241)
          at sun.nio.ch.IOUtil.read(IOUtil.java:195)
          at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
          at org.apache.kafka.common.network.PlaintextTransportLayer.read(PlaintextTransportLayer.java:104)
          at org.apache.kafka.common.network.NetworkReceive.readFrom(NetworkReceive.java:117)
          at org.apache.kafka.common.network.KafkaChannel.receive(KafkaChannel.java:335)
          at org.apache.kafka.common.network.KafkaChannel.read(KafkaChannel.java:296)
          at org.apache.kafka.common.network.Selector.attemptRead(Selector.java:562)
          at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:498)
          at org.apache.kafka.common.network.Selector.poll(Selector.java:427)
          at kafka.network.Processor.poll(SocketServer.scala:679)
          at kafka.network.Processor.run(SocketServer.scala:584)
          at java.lang.Thread.run(Thread.java:748)

       the kafka server is not shutdown, but always get this error. And at the same time, data can not be produced to kafka cluster, consumer can not consume data from kafka cluster.

      We used the recommended java parameter XX:+ExplicitGCInvokesConcurrent  but it seems not useful. 

       Only kafka cluster restart helps to fix this problem.

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            diehu diehu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: