它发生在我的vps中。
[root@kunphen ~]# free -m
total used free shared buffers cached
Mem: 12067 87 11980 0 0 0
-/+ buffers/cache: 87 11980
Swap: 0 0 0
[root@kunphen ~]# java -version
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
当我将其更改为“java -Xms16m -Xmx16m -version”时,它可以工作。我尝试了很多次。它的最大大小是 22m,但我的内存也有很多空闲区域。