kafka启动报错Native memory allocation (mmap) failed to map 1073741824 bytes for

环境说明

使用了腾讯云的免费试用的1CPU/1GB服务器,通过bin/kafka-server-start.sh config/server.properties命令启动kafka服务,出现以下错误:

OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
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.
# Native memory allocation (mmap) failed to map 1073741824 bytes for committing reserved memory.
# An error report file with more information is saved as:

问题分析

kafka启用时默认要求分配1GB的内存,由于免费服务器性能限制,出现内存分配的异常

问题解决

修改kafka-server-start.sh文件:
kafka启动报错Native memory allocation (mmap) failed to map 1073741824 bytes for_第1张图片
重启执行启动命令即可。

你可能感兴趣的:(kafka)