• <legend id='ELvR5'><style id='ELvR5'><dir id='ELvR5'><q id='ELvR5'></q></dir></style></legend>

        <bdo id='ELvR5'></bdo><ul id='ELvR5'></ul>
      <i id='ELvR5'><tr id='ELvR5'><dt id='ELvR5'><q id='ELvR5'><span id='ELvR5'><b id='ELvR5'><form id='ELvR5'><ins id='ELvR5'></ins><ul id='ELvR5'></ul><sub id='ELvR5'></sub></form><legend id='ELvR5'></legend><bdo id='ELvR5'><pre id='ELvR5'><center id='ELvR5'></center></pre></bdo></b><th id='ELvR5'></th></span></q></dt></tr></i><div id='ELvR5'><tfoot id='ELvR5'></tfoot><dl id='ELvR5'><fieldset id='ELvR5'></fieldset></dl></div>

      <small id='ELvR5'></small><noframes id='ELvR5'>

      1. <tfoot id='ELvR5'></tfoot>

        Kafka Connect 堆空间不足

        时间:2023-08-24
        <tfoot id='MPILi'></tfoot>
        <legend id='MPILi'><style id='MPILi'><dir id='MPILi'><q id='MPILi'></q></dir></style></legend>
              <i id='MPILi'><tr id='MPILi'><dt id='MPILi'><q id='MPILi'><span id='MPILi'><b id='MPILi'><form id='MPILi'><ins id='MPILi'></ins><ul id='MPILi'></ul><sub id='MPILi'></sub></form><legend id='MPILi'></legend><bdo id='MPILi'><pre id='MPILi'><center id='MPILi'></center></pre></bdo></b><th id='MPILi'></th></span></q></dt></tr></i><div id='MPILi'><tfoot id='MPILi'></tfoot><dl id='MPILi'><fieldset id='MPILi'></fieldset></dl></div>

                  <tbody id='MPILi'></tbody>
              • <small id='MPILi'></small><noframes id='MPILi'>

                  <bdo id='MPILi'></bdo><ul id='MPILi'></ul>
                  本文介绍了Kafka Connect 堆空间不足的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  启动 Kafka Connect (connect-standalone) 后,我的任务在启动后立即失败:

                  After starting Kafka Connect (connect-standalone), my task fails immediately after starting with:

                  java.lang.OutOfMemoryError: Java heap space
                      at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:57)
                      at java.nio.ByteBuffer.allocate(ByteBuffer.java:335)
                      at org.apache.kafka.common.network.NetworkReceive.readFromReadableChannel(NetworkReceive.java:93)
                      at org.apache.kafka.common.network.NetworkReceive.readFrom(NetworkReceive.java:71)
                      at org.apache.kafka.common.network.KafkaChannel.receive(KafkaChannel.java:154)
                      at org.apache.kafka.common.network.KafkaChannel.read(KafkaChannel.java:135)
                      at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:343)
                      at org.apache.kafka.common.network.Selector.poll(Selector.java:291)
                      at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:260)
                      at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:232)
                      at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:180)
                      at org.apache.kafka.clients.consumer.internals.AbstractCoordinator.ensureCoordinatorReady(AbstractCoordinator.java:193)
                      at org.apache.kafka.clients.consumer.internals.ConsumerCoordinator.poll(ConsumerCoordinator.java:248)
                      at org.apache.kafka.clients.consumer.KafkaConsumer.pollOnce(KafkaConsumer.java:1013)
                      at org.apache.kafka.clients.consumer.KafkaConsumer.poll(KafkaConsumer.java:979)
                      at org.apache.kafka.connect.runtime.WorkerSinkTask.pollConsumer(WorkerSinkTask.java:316)
                      at org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:222)
                      at org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:170)
                      at org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:142)
                      at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:140)
                      at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:175)
                      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                      at java.lang.Thread.run(Thread.java:745)
                  

                  在一些Kafka文档中提到了堆空间,告诉你用默认"尝试它,只有在有问题时才修改它,但没有修改堆空间的说明.

                  There's a mention of heap space in some Kafka documentation, telling you to try it with "the default" and only modifying it if there are problems, but there are no instructions to modify the heap space.

                  推荐答案

                  您可以通过设置 KAFKA_HEAP_OPTS 环境变量来控制最大和初始堆大小.

                  You can control the max and initial heap size by setting the KAFKA_HEAP_OPTS environment variable.

                  以下示例设置了 512 MB 的起始大小和 1 GB 的最大大小:

                  The following example sets a starting size of 512 MB and a maximum size of 1 GB:

                  KAFKA_HEAP_OPTS="-Xms512m -Xmx1g" connect-standalone connect-worker.properties connect-s3-sink.properties
                  

                  当运行 connect-standalone 等 Kafka 命令时,会调用 kafka-run-class 脚本,该脚本 在 KAFKA_HEAP_OPTS 中设置默认堆大小为 256 MB环境变量(如果尚未设置).

                  When running a Kafka command such as connect-standalone, the kafka-run-class script is invoked, which sets a default heap size of 256 MB in the KAFKA_HEAP_OPTS environment variable if it is not already set.

                  这篇关于Kafka Connect 堆空间不足的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Java 版本之间是否存在向后不兼容的具体示例? 下一篇:OpenJDK 与 Java HotspotVM

                  相关文章

                • <tfoot id='GaTeq'></tfoot>

                  <small id='GaTeq'></small><noframes id='GaTeq'>

                    <i id='GaTeq'><tr id='GaTeq'><dt id='GaTeq'><q id='GaTeq'><span id='GaTeq'><b id='GaTeq'><form id='GaTeq'><ins id='GaTeq'></ins><ul id='GaTeq'></ul><sub id='GaTeq'></sub></form><legend id='GaTeq'></legend><bdo id='GaTeq'><pre id='GaTeq'><center id='GaTeq'></center></pre></bdo></b><th id='GaTeq'></th></span></q></dt></tr></i><div id='GaTeq'><tfoot id='GaTeq'></tfoot><dl id='GaTeq'><fieldset id='GaTeq'></fieldset></dl></div>
                    <legend id='GaTeq'><style id='GaTeq'><dir id='GaTeq'><q id='GaTeq'></q></dir></style></legend>

                        <bdo id='GaTeq'></bdo><ul id='GaTeq'></ul>