本文共 1401 字,大约阅读时间需要 4 分钟。
今天在一台机器上查看java进行时,运行jps -m时报如下错误:
1 2 3 | Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine. |
1 2 3 4 5 | free -m total used free shared buffers cached Mem: 64412 27418 36994 0 174 13226 -/+ buffers /cache : 14018 50394 Swap: 0 0 0 |
1 2 3 4 5 6 7 8 9 10 11 | 0 — The default setting. The kernel performs heuristic memory overcommit handling by estimating the amount of memory available and failing requests that are blatantly invalid. Unfortunately, since memory is allocated using a heuristic rather than a precise algorithm, this setting can sometimes allow available memory on the system to be overloaded. 1 — The kernel performs no memory overcommit handling. Under this setting, the potential for memory overload is increased, but so is performance for memory-intensive tasks. 2 — The kernel denies requests for memory equal to or larger than the sum of total available swap and the percentage of physical RAM specified in overcommit_ratio. This setting is best if you want a lesser risk of memory overcommitment. |
可以看出2是比较严格的限制,1是最宽松的限制,对于不同的应用对这个参数的要求页不一样。