java - JVM内存设置后TOMCAT无法启动
巴扎黑
巴扎黑 2017-04-17 14:55:03
[Java讨论组]

linux服务器内存大小8G,通过top命令查看可知,当前系统其它进程占用了1G内存。当我设置Xmx为3600M时可正常启动,但是3700M时就无法启动了,依次试过4000M,都不行,报错代码如下,下面三种错误都有报过:

Error occurred during initialization of VM·
Could not reserve enough space for object heap
Could not create the Java virtual machine. 

不知道这个问题如何理解,求高手解答。理论上来说,就算JDK是32位的,应该也能支持4G内存大小

巴扎黑
巴扎黑

全部回复(2)
高洛峰

Oracle 官方文档:
The maximum theoretical heap limit for the 32-bit JVM is 4G. Due to various additional constraints such as available swap, kernel address space usage, memory fragmentation, and VM overhead, in practice the limit can be much lower. On most modern 32-bit Windows systems the maximum heap size will range from 1.4G to 1.6G. On 32-bit Solaris kernels the address space is limited to 2G. On 64-bit operating systems running the 32-bit VM, the max heap size can be higher, approaching 4G on many Solaris systems.


帮你翻译一下吧:
理论上,32位的Java虚拟机的Heap(堆)的上限是4G,然而由于其他各种限制,比如可用的交换区,内核地址空间使用,内存碎片和VM overhead(JVM的开销?栈?)等,实际上这个上限可能远小于理论值。在大多数32位的Windows系统上,实际值从1.4G到1.6G不等。在32位的Solaris内核中,地址空间限定到2G。在64位操作系统上运行32位Java虚拟机,该值可能要高一些,比如在很多Solaris系统上就接近4G。

ringa_lee

我想问下,从哪里设置这个jvm的大小?

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号