简体   繁体   English

使用'jdk 1.8'重新启动Tomcat'apache-tomcat-8.0.33'时GC分配失败

[英]Allocation Failure of GC while restarting Tomcat 'apache-tomcat-8.0.33' with 'jdk 1.8'

I have a webapp using JDK1.6 and Tomcat 6 . 我有一个使用JDK1.6Tomcat 6的webapp。 After I set the webapp to use apache-tomcat-8.0.33 and jdk1.8 , I stop Tomcat and start it again. 在将webapp设置为使用apache-tomcat-8.0.33jdk1.8 ,我停止了Tomcat并重新启动它。 I see an error in log file as: 我在日志文件中看到一个错误:

Java HotSpot(TM) 64-Bit Server VM (25.5-b02) for linux-amd64 JRE (1.8.0_05-b13), built on Mar 18 2014 00:29:27 by "java_re" with gcc 4.3.0 20080428 (Red Hat 4.3.0-8) 适用于linux-amd64 JRE(1.8.0_05-b13)的Java HotSpot(TM)64位服务器VM(25.5-b02),由“ java_re”和gcc 4.3.0 20080428(红色)于2014年3月18日00:29:27构建(红色帽子4.3.0-8)
Memory: 4k page, physical 32960008k(1705688k free), swap 4095992k(9328k free) 内存:4k页,物理32960008k(免费1705688k),交换4095992k(免费9328k)

CommandLine flags: -XX:+CMSClassUnloadingEnabled -XX:InitialHeapSize=1073741824 -XX:MaxHeapSize=2097152000 -XX:+PrintGC -XX:+PrintGCTimeStamps -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseParallelGC 命令行标志:-XX:+ CMSClassUnloadingEnabled -XX:InitialHeapSize = 1073741824 -XX:MaxHeapSize = 2097152000 -XX:+ PrintGC -XX:+ PrintGCTimeStamps -XX:+ UseCompressedClassPointers -XX:+ UseCompressedOops -XX:+ UseParallelGC

0.299: [GC (Allocation Failure) 512K->384K(1048064K), 0.0023630 secs] 0.299:[GC(分配失败)512K-> 384K(1048064K),0.0023630秒]
0.462: [GC (Allocation Failure) 896K->664K(1048064K), 0.0024930 secs] 0.462:[GC(分配失败)896K-> 664K(1048064K),0.0024930秒]

What may be the problem? 可能是什么问题?

There are typically two reasons for these errors with tomcat. tomcat出现这些错误通常有两个原因。 1. You aren't allocating enough memory. 1.您没有分配足够的内存。 2. You are allocating too much memory. 2.您分配的内存过多。

I would wager #2. 我下注#2。

I might be misreading this: 我可能会读错:

Memory: 4k page, physical 32960008k(1705688k free)

But that seems to indicate that you have 1.7GB of available memory. 但这似乎表明您有1.7GB的可用内存。 Your heap is taking 1GB initially, with a maximum of 2GB. 您的堆最初占用1GB,最大为2GB。 That doesn't leave a whole lot of available memory. 那不会留下很多可用的内存。

Unless you really need 1GB heap space, you should reduce that significantly, as well as the maximum heap size. 除非您确实需要1GB的堆空间,否则应大幅度减少堆空间以及最大堆大小。

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

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