简体   繁体   English

Tomcat 8的系统RAM的最大使用率

[英]Maximum usage of system RAM for Tomcat 8

I have a PC which contains 8 GB RAM and more than 5 GB free RAM. 我有一台包含8 GB RAM和超过5 GB可用RAM的PC。 The picture below shows more details. 下图显示了更多详细信息。

What's the maximum usage of RAM memory allocated for Tomcat according to the picture and how can I increase this usage limit? 根据图片为Tomcat分配的RAM内存的最大使用量是多少?如何增加此使用量限制?

The Operating System is Windows 7 64-bit 操作系统是Windows 7 64位

在此处输入图片说明

According to the image you posted, the current Java maximum heap size has been set to (or has defaulted to) 1819 MB. 根据您发布的图像,当前Java最大堆大小已设置为(或默认为)1819 MB。

The theoretical maximum for your machine will be something in the vicinity of 12 to 14 GB, based on the page file size. 根据页面文件的大小,您的计算机的理论最大值约为12到14 GB。 (It is difficult to be sure because it depends on what other OS processes, etc are using space in the page file.) (很难确定,因为这取决于其他OS进程等正在使用页面文件中的空间。)

A more practical limit would be around 6GB, based on the current amount of free RAM reported by the OS. 根据操作系统报告的当前可用RAM数量,更实际的限制约为6GB。 (You could go above 6GB, but if you push memory usage beyond the limits of physical RAM, there is a risk that performance will be degraded due to VM thrashing, especially during major garbage collections.) (您可能会超过6GB,但是如果将内存使用量推到物理RAM的限制之外,则存在由于VM抖动而导致性能下降的风险,尤其是在大型垃圾回收期间。)

If want to increase the Tomcat JVM's max heap size beyond what it is currently set to, you need to find the place where Tomcat's JVM command line options are set, and add an -Xmx... option (or modify the existing one). 如果要使Tomcat JVM的最大堆大小超出当前设置的大小,则需要找到设置Tomcat的JVM命令行选项的位置,并添加-Xmx...选项(或修改现有选项)。

Refer to the Tomcat documentation for your platform and / or the manual entry for the java command where the JVM heap sizing options are documented. 请参阅所用平台的Tomcat文档和/或java手册手册,其中记录了JVM堆大小调整选项。


On the flipside, 1800 MB should be plenty of space for a typical Tomcat service. 另一方面,典型的Tomcat服务应该有1800 MB的空间。 And it looks like your JVM is not under memory pressure at the moment. 而且看起来您的JVM目前没有受到内存压力。 Based on this information, I wouldn't be looking to change the max heap size right now. 基于此信息,我现在不会在更改最大堆大小。

From the picture it seems that you are using a Windows 7, 64 bits. 从图片看来,您正在使用Windows 7、64位。 To allocate more memory to your tomcat instance you will have to play with the JVM initialisation params. 要为您的tomcat实例分配更多的内存,您将不得不使用JVM初始化参数。

Example given: 给出的例子:

-Xms2G -Xmx6G -XX:PermSize=256m -XX:MaxPermSize=512m -Xms2G -Xmx6G -XX:PermSize = 256m -XX:MaxPermSize = 512m

On Windows you might want to add these to your JAVA_OPTS in your bin/catalina.bat 在Windows上,您可能需要将它们添加到bin / catalina.bat中的JAVA_OPTS中

Here is a reading suggestion around the params: http://www.mkyong.com/java/find-out-your-java-heap-memory-size/ 这是有关该参数的阅读建议: http : //www.mkyong.com/java/find-out-your-java-heap-memory-size/

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

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