kafka启动报错Cannot allocate memory;There is insufficient memory for the Java Runtime Environment to continue.

时间:2024-04-10 17:05:10

kafka启动过程报错,配置没有问题,这就懵了!!

Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c0130000, 986513408, 0) failed; error='Cannot allocate memory' (errno=12)

说是内存不足,没办法,请教同学之后了解到kafka默认内存是1g,然后直接vim为100m就好了,具体就是:

{$KAFKA_HOME}/bin下,直接

vim kafka-server-start.sh

然后更改其中的export KAFKA_HEAP_OPTS="-Xmx1G -Xms1G"
为export KAFKA_HEAP_OPTS="-Xmx100m -Xms100m"