Menu

Apache Kafka broker unable to start – Error:Cannot allocate memory

Unable to start Kafka Broker

When tried to start the kafka broker, if you get the below error, its because of less memory on the system.

Error Message:

OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c0000000, 1073741824, 0) failed; error=’Cannot allocate memory’ (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
Solution : enter the below line in the linux promt.

In this situation, there are two options to fix and manage to start the kafka broker.
1. Just set environment variables as :
 #export KAFKA_HEAP_OPTS=”-Xmx256M -Xms128M”
Directly run the above command in the terminal. You can also modify the value based on your needs. 1st is max and other is min.
2. updated the value for minimum and maximum memory allocation in the kafka-server-startup.sh file.
Value to update : -Xmx256M -Xms128M

Loading

Categories:   Apache, Kafka

Tags:  , ,

Comments