Hi Ambica,

Am 04.01.2018 um 17:17 schrieb Sanka, Ambica:
I am seeing below highlighted errors in native_err logs in all my tomcat 
applications. I also increased memory for the VM from 4GB to 8GB. Still seeing 
those. When do we get that errors?
I am reading online that when program asks for memory and java cannot give, 
that's when we see them. Please suggest.
Java HotSpot(TM) 64-Bit Server VM (25.20-b23) for linux-amd64 JRE (1.8.0_20-b26), built 
on Jul 30 2014 13:13:52 by "java_re" with gcc 4.3.0 20080428 (Red Hat 4.3.0-8)
Memory: 4k page, physical 8061572k(2564740k free), swap 4063228k(4063228k free)
CommandLine flags: -XX:+HeapDumpOnOutOfMemoryError 
-XX:HeapDumpPath=/opt/apache/ancillariesmonitoring/logs/ 
-XX:InitialHeapSize=128985152 -XX:MaxHeapSize=268435456 -XX:+PrintGC 
-XX:+PrintGCTimeStamps -XX:+UseCompressedClassPointers -XX:+UseCompressedOops 
-XX:+UseParallelGC
3.203: [GC (Allocation Failure)  31744K->6311K(121856K), 0.0097261 secs]
3.578: [GC (Allocation Failure)  38055K->12368K(121856K), 0.0089875 secs]
3.756: [GC (Allocation Failure)  44112K->19589K(121856K), 0.0100339 secs]
3.897: [GC (Allocation Failure)  51333K->25872K(153600K), 0.0092326 secs]
4.172: [GC (Allocation Failure)  89360K->38878K(153600K), 0.0152940 secs]
4.417: [GC (Allocation Failure)  102366K->50311K(148480K), 0.0148816 secs]
4.594: [GC (Allocation Failure)  95367K->49903K(151040K), 0.0197327 secs]
4.765: [GC (Allocation Failure)  94959K->50213K(148992K), 0.0149008 secs]
4.946: [GC (Allocation Failure)  96293K->52257K(150528K), 0.0172634 secs]
5.129: [GC (Allocation Failure)  98337K->53118K(151040K), 0.0139426 secs]
5.313: [GC (Allocation Failure)  102270K->53234K(152064K), 0.0122307 secs]
5.498: [GC (Allocation Failure)  102386K->53579K(153088K), 0.0166336 secs]
5.655: [GC (Allocation Failure)  104779K->54486K(153600K), 0.0161735 secs]
6.885: [GC (Allocation Failure)  105686K->51523K(153600K), 0.0123126 secs]

These messages are normal, as long as there are not other problems or errors they are nothing to worry about.

Java manages memory in regions of different sizes and meaning. Allocation for new objects is done in the so-called eden space. This memory region is managed in a very simple way. The JVM allocates from it until it is full (not enough free space left for the current allocation). Then it interrupts the application and runs a Garbage Collection (GC) for this memory region, copying any objects which are still alive from this region into another one (typically into one of the two survivor spaces). At the end of the GC run, eden will be fully cleared and the application can continue, again allocating from eden.

The above message is shown, whenever a GC run for eden happens. The reason for the GC run is shown, here "(Allocation Failure)". The GC for eden in your case takes about 10-20 milliseconds and runs about 4-5 times per second. The string "Failure" is somewhat misleading, the failed allocation will be retried and typically succeeds once the GC finishes.

Although you can adjust eden size with specific JVM flags, you probably have only set the heap size, which is the combined size of several JVM memory regions. In that case the JVM will try to auto-tune eden size. If you want to set eden size explicitly, you might need to do more measurements to deduce good settings from those. That would be a somewhat more difficult and not Tomcat specific topic.

Unrelated: note that you JVM 8 patch level 20 is very old.

Regards,

Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to