RocketMQ启动报错解决:Using the DefNew young collector with the CMS collector is deprecated and will likely
启动nameserver报错了,如下
[root@localhost bin]# sh mqnamesrv
Java HotSpot(TM) 64-Bit Server VM warning: Using the DefNew young collector with the CMS collector is deprecated and will likely be removed in a future release
Java HotSpot(TM) 64-Bit Server VM warning: UseCMSCompactAtFullCollection is deprecated and will likely be removed in a future release.
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000006ec800000, 2147483648, 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 2147483648 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /rocketmq/bin/hs_err_pid12708.log
原因是rocketmq默认启动内存是4G,我们电脑虚拟机一般内存有限,没有这么大内存,所以得修改这个值,把值修改小一点,得修改两个配置文件:
runbroker.sh 和runserver.sh
把内存改成适合的大小1g或者256m都可以