今天下载了一个elasticsearch8.4.3 windows版本的es,配置好相应的配置后,启动bat文件,输出一行信息后,窗口就闪退了。于是通过cmd窗口运行,发现了报错信息如下
Exception in thread "main" java.lang.RuntimeException: starting java failed with [1]
output:
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 4294967296 bytes for G1 virtual space
# An error report file with more information is saved as:
# logs/hs_err_pid3913340.log
error:
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000700000000, 4294967296, 0) failed; error='???????С???
??????????' (DOS error/errno=1455)
at org.elasticsearch.server.cli.JvmOption.flagsFinal(JvmOption.java:113)
at org.elasticsearch.server.cli.JvmOption.findFinalOptions(JvmOption.java:80)
at org.elasticsearch.server.cli.MachineDependentHeap.determineHeapSettings(MachineDependentHeap.java:59)
at org.elasticsearch.server.cli.JvmOptionsParser.jvmOptions(JvmOptionsParser.java:132)
at org.elasticsearch.server.cli.JvmOptionsParser.determineJvmOptions(JvmOptionsParser.java:90)
at org.elasticsearch.server.cli.ServerProcess.createProcess(ServerProcess.java:211)
at org.elasticsearch.server.cli.ServerProcess.start(ServerProcess.java:106)
at org.elasticsearch.server.cli.ServerProcess.start(ServerProcess.java:89)
at org.elasticsearch.server.cli.ServerCli.startServer(ServerCli.java:234)
at org.elasticsearch.server.cli.ServerCli.execute(ServerCli.java:91)
at org.elasticsearch.common.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:54)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:85)
at org.elasticsearch.cli.Command.main(Command.java:50)
at org.elasticsearch.launcher.CliToolLauncher.main(CliToolLauncher.java:64)
解决办法如下,修改config目录下的jvm.options文件,
32行和33行是配置java内存的,这里注释掉,就是默认是没有配置的,这里自己单独配置小一点,我这边配置了2g,就可以正常启动起来了,如下图
文章来源:https://www.toymoban.com/news/detail-577913.html
文章来源地址https://www.toymoban.com/news/detail-577913.html
到了这里,关于windows运行elasticsearch报错Native memory allocation (mmap) failed to map 4294967296 bytes for G1的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!