kafka 8和内存 - Java Runtime Environment没有足够的内存来继续 [英] kafka 8 and memory - There is insufficient memory for the Java Runtime Environment to continue

查看:126
本文介绍了kafka 8和内存 - Java Runtime Environment没有足够的内存来继续的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用DigiOcean实例和512兆内存,我用kafka得到了以下错误。
我不是一个java熟练的开发者。如何调整kafka以利用少量的ram。这是一个开发者。我不想每小时为更大的机器支付更多费用。

I am using DigiOcean instance with 512 megs of ram, I get the below error with kafka. I am not a java proficient dev. How do I adjust kafka to utilize the small amount of ram. This is a dev sever. I dont want to pay more per hour for a bigger machine.

#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 986513408 bytes for committing reserved memory.
# An error report file with more information is saved as:
# //hs_err_pid6500.log
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000bad30000, 986513408, 0) failed; error='Cannot allocate memory' (errno=12)


推荐答案

您可以通过编辑 kafka-server-start.sh zookeeper-server-start.sh 依此类推:

You can adjust the JVM heap size by editing kafka-server-start.sh, zookeeper-server-start.shand so on:

export KAFKA_HEAP_OPTS="-Xmx1G -Xms1G"

-Xms 参数指定最小堆大小。要让您的服务器至少启动,请尝试将其更改为使用更少的内存。鉴于您只有512M,您应该更改最大堆大小( -Xmx ):

The -Xms parameter specifies the minimum heap size. To get your server to at least start up, try changing it to use less memory. Given that you only have 512M, you should change the maximum heap size (-Xmx) too:

export KAFKA_HEAP_OPTS="-Xmx256M -Xms128M"

我不确定默认配置中kafka的最小内存要求是什么 - 可能需要调整kafka中的消息大小才能使其运行。

I'm not sure what the minimal memory requirements of kafka in default config are - maybe you need to adjust the message size in kafka to get it to run.

这篇关于kafka 8和内存 - Java Runtime Environment没有足够的内存来继续的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆