Ayhan ARDA

Kafka restartında Memory Allocation Error Hatası

Kafka restartında Memory Allocation Error Hatası

Kafka başlarken aşağıdaki gibi bir hataya düştüğünde ki bu normalde olmuyorsa ama topic sayınız arttı ise genelde olur , bu durumda aşağıdaki çözümü uygulayabilirsiniz.

Java HotSpot(TM) 64-Bit Server VM warning: Attempt to protect stack guard pages failed.
Java HotSpot(TM) 64-Bit Server VM warning: Attempt to deallocate stack guard pages failed.
[] INFO [TransactionCoordinator id=3] Startup complete. (kafka.coordinator.transaction.TransactionCoordinator)
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00007f4e0ff1b000, 12288, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 12288 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /opt/kafka/bin/hs_err_pid1234.log
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00007f4eed723000, 262144, 0) failed; error='Cannot allocate memory' (errno=12)
[thread 139981501064960 also had an error]
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00007f4fe5cc0000, 65536, 1) failed; error='Cannot allocate memory' (errno=12)
[thread 139980200949504 also had an error]

Linux sysctl ayarlarınızda vm.max_map_count değerini arttırmalıyız.

sysctl -w vm.max_map_count= #ön tanımlı değeri 65536
Aşağıdaki değeri basabiliriz.
sysctl -w vm.max_map_count=262144
Aktif olması için sysctl -p komutunu kullanabilirsiniz.

Ayhan ARDA

Exit mobile version