There is hardly any way anyone can guess what happens there from just
the numbers.
What you should do is start Kafka with -XX:+HeapDumpOnOutOfMemoryError,
possibly even reduce the Xmx to 500MB and let it bomb out. Then you take
a look at the generated heap dump with the Eclipse Memory Analyzer
(https://eclipse.org/mat/downloads.php). Check the dominator tree and
see where most of the memory is used. From this figure out why it was
not released.
Harald.
On 26.08.2016 07:45, 黄川 wrote:
is there anybody can help me?
2016-08-23 8:49 GMT+08:00 黄川 <buptst...@gmail.com>:
Hi, I am using kafka_2.11-0.9.0.1, there are multiple of warnings occur
in kafkaServer.out:
java.lang.OutOfMemoryError: Java heap space.
- the jstat output like this:
# jstat -gc 28591
S0C S1C S0U S1U EC EU OC OU MC
MU CCSC CCSU YGC YGCT FGC FGCT GCT
0.0 0.0 0.0 0.0 18432.0 9216.0 1030144.0 1029128.8
26240.0 25918.9 3456.0 3398.8 34673 1104.062 10772 37219.665 38323.727
- kafkaServer-gc.log:
2016-08-19T08:40:59.352+0800: 84889.380: [Full GC (Allocation Failure)
1017M->1017M(1024M), 3.3727202 secs]
[Eden: 0.0B(51.0M)->0.0B(51.0M) Survivors: 0.0B->0.0B Heap:
1017.7M(1024.0M)->1017.7M(1024.0M)], [Metaspace: 26056K->26056K(1073152K)]
it seems that full gc can not recycle any memory any more.My gc settings
is as follows:
-Xmx1G
-Xms1G
-XX:+UseG1GC
-XX:MaxGCPauseMillis=20
-XX:InitiatingHeapOccupancyPercent=35
-XX:+DisableExplicitGC
-Djava.awt.headless=true
-Xloggc:/var/log/kafka/kafkaServer-gc.log
-verbose:gc
-XX:+PrintGCDetails
-XX:+PrintGCDateStamps
-XX:+PrintGCTimeStamps
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Dkafka.logs.dir=/var/log/kafka
-Dlog4j.configuration=file:/usr/lib/kafka/bin/../config/log4j.properties