风一般的男人

0 声望

这家伙太懒,什么都没留下

个人动态
  • 风一般的男人 回复 Sulykafka生产者发送消息失败导致内存溢出java.lang.OutOfMemoryError:Java heap space,请教如何解决? 中 :
    bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test
    
    [2019-10-10 17:02:09,513] ERROR Uncaught exception in thread 'kafka-producer-network-thread | console-producer': (org.apache.kafka.common.utils.KafkaThread)
    java.lang.OutOfMemoryError: Java heap space
    at java.nio.HeapByteBuffer.(HeapByteBuffer.java:57)
    at java.nio.ByteBuffer.allocate(ByteBuffer.java:335)
    at org.apache.kafka.common.memory.MemoryPool$1.tryAllocate(MemoryPool.java:30)
    at org.apache.kafka.common.network.NetworkReceive.readFrom(NetworkReceive.java:112)
    at org.apache.kafka.common.network.KafkaChannel.receive(KafkaChannel.java:424)
    at org.apache.kafka.common.network.KafkaChannel.read(KafkaChannel.java:385)
    at org.apache.kafka.common.network.Selector.attemptRead(Selector.java:651)
    at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:572)
    at org.apache.kafka.common.network.Selector.poll(Selector.java:483)
    at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:539)
    at org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:331)
    at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:238)
    at java.lang.Thread.run(Thread.java:748)
    

    一直报这个错,是什么原因?
    已经执行了export KAFKA_HEAP_OPTS="-Xmx1G -Xms1G"还是一样。

    5年前