0

I have a webapp using JDK1.6 and Tomcat 6. After I set the webapp to use apache-tomcat-8.0.33 and jdk1.8, I stop Tomcat and start it again. 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)
Memory: 4k page, physical 32960008k(1705688k free), swap 4095992k(9328k free)

CommandLine flags: -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.462: [GC (Allocation Failure) 896K->664K(1048064K), 0.0024930 secs]

What may be the problem?

zx485
  • 28,498
  • 28
  • 50
  • 59
Shaily
  • 1
  • 2
  • Although it sounds alarming "Allocation Failure" isn't necessarily an error. See http://stackoverflow.com/questions/28342736/java-gc-allocation-failure – matt freake Apr 29 '16 at 16:43

1 Answers1

0

There are typically two reasons for these errors with tomcat. 1. You aren't allocating enough memory. 2. You are allocating too much memory.

I would wager #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. Your heap is taking 1GB initially, with a maximum of 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.

Christopher Schneider
  • 3,745
  • 2
  • 24
  • 38