执行命令:sudo service elasticsearch restart
Stopping elasticsearch: [FAILED]
Starting elasticsearch: [ OK ]
[ec2-user@ip-10-237-177-6 bin]$ Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000736260000, 2312765440, 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 2312765440 bytes for committing reserved memory.
An error report file with more information is saved as:
/tmp/hs_err_pid11958.log
检查Java版本:
[ec2-user@ip-10-237-177-6 bin]$ java -version
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
内存的Java配置:
[ec2-user@ip-10-237-177-6 bin]$ java -XX:+PrintFlagsFinal -version | grep -iE 'HeapSize|PermSize|ThreadStackSize'
intx CompilerThreadStackSize = 0 {pd product}
uintx ErgoHeapSizeLimit = 0 {product}
uintx HeapSizePerGCThread = 87241520 {product}
uintx InitialHeapSize := 65011712 {product}
uintx LargePageHeapSizeThreshold = 134217728 {product}
uintx MaxHeapSize := 1038090240 {product}
intx ThreadStackSize = 1024 {pd product}
intx VMThreadStackSize = 1024 {pd product}