简体   繁体   English

64位CentOs上Tomcat 6的最大堆大小?

[英]Max Heap Size for Tomcat 6 on 64 bit CentOs?

I am running a tomcat 6 instance on a large EC2 instance running CentOS 5.4. 我在运行CentOS 5.4的大型EC2实例上运行tomcat 6实例。 The box has 7.5gb of RAM and is dedicated to running tomcat. 该盒子有7.5GB的RAM,专用于运行tomcat。

I am trying to give the box 6gb of RAM to use for it's max heap. 我试图给它的盒子6GB的RAM用于它的最大堆。 However I keep getting this error: 但是我一直收到这个错误:

Invalid maximum heap size: -Xmx6144m
The specified size exceeds the maximum representable size.

As I drop the amount of RAM I give it I start getting this error instead: 当我丢弃我给它的RAM量时,我开始得到这个错误:

Error occurred during initialization of VM
Could not reserve enough space for object heap

Even with the app running (with xmx3000m) when I run free I have this amount free: 即使应用程序运行(使用xmx3000m),当我免费运行时,我有这个金额免费:

 [tomcat@producer1:/usr/share/tomcat/logs] $free
             total       used       free     shared    buffers     cached
Mem:       7864320    1512736    6351584          0     179948     702352
-/+ buffers/cache:     630436    7233884
Swap:            0          0          0

The most I am able to give it is 3000m. 我能给予的最多是3000米。 This seems unreasonably small. 这似乎不合理地小。 Anyone have any ideas? 有人有主意吗? Thanks 谢谢

Do you have 64 bit JDK installed? 你有64位JDK安装? If you are using a 32 bit JDK it can max access 4GB (theoretically). 如果您使用的是32位JDK,则最大可以访问4GB(理论上)。 As you are planning for 6GB, you require 64bit JDK. 当你计划6GB时,你需要64位JDK。 Added to that as you have 7.5G, 6GB is a tight no. 除此之外,因为你有7.5G,6GB是紧的没有。 CentOS requires some memory for kernal, processing other services, SWAP memory from this. CentOS需要一些内核用于内核,处理其他服务,SWAP内存。

So give a trial & error by increasing heap size from 5G onwards. 因此,通过从5G开始增加堆大小来进行试验和错误。 JDK requires additional memory beyond heap like permgenspace (which is typically 128M - 512M depending on how many libraries/classloaders you have) JDK需要超出堆的额外内存,如permgenspace(通常为128M - 512M,具体取决于您拥有的库/类加载器的数量)

Refer to : http://benjchristensen.com/2007/02/16/32-bit-versus-64-bit-jdk-memory-usage/ 请参阅: http//benjchristensen.com/2007/02/16/32-bit-versus-64-bit-jdk-memory-usage/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM