G1GC-高内存消耗问题

时间:2019-08-26 10:35:39

标签: java g1gc

我正在使用具有以下提到的G1GC配置的G1GC。我正在使用Open Jdk 1.8。在使用此配置时,我一直遇到高内存问题。我的机器RAM为32 GB,并且使用16GB作为堆。但是有时会消耗多达20至22 GB的内存并导致问题。以前使用8Gb作为RAM,之后发生一些频繁的重新启动,将堆大小增加到16GB。这台机器现在每天处理大约1.6L请求。请帮助并建议我一些GC选项来解决此问题。

<jvmarg line="-Xms16384M"/>
<jvmarg line="-Xmx16384M"/>
<jvmarg line="-verbose:gc" />
<jvmarg line="-XX:+UseG1GC"/>
<jvmarg line="-XX:+PrintGCDetails" />
<jvmarg line="-XX:+PrintGCTimeStamps" />
<jvmarg line="-XX:+PrintTenuringDistribution" />
<jvmarg line="-XX:+PrintGCApplicationStoppedTime" />
<jvmarg line="-XX:MaxGCPauseMillis=200"/>
<jvmarg line="-XX:InitiatingHeapOccupancyPercent=40" />
<jvmarg line="-XX:G1HeapRegionSize=4M" />
<jvmarg line="-XX:MaxJavaStackTraceDepth=-1"/>

GC日志:

- age   1:    2536680 bytes,    2536680 total
- age   2:   16623888 bytes,   19160568 total
- age   3:    1235560 bytes,   20396128 total
- age   4:     673656 bytes,   21069784 total
- age   5:     689128 bytes,   21758912 total
- age   6:     686328 bytes,   22445240 total
- age   7:     635968 bytes,   23081208 total
- age   8:     322736 bytes,   23403944 total
- age   9:     423208 bytes,   23827152 total
- age  10:     333248 bytes,   24160400 total
- age  11:     176584 bytes,   24336984 total
- age  12:      77608 bytes,   24414592 total
- age  13:     138640 bytes,   24553232 total
- age  14:     121456 bytes,   24674688 total
- age  15:     144920 bytes,   24819608 total
, 0.0568128 secs]
   [Parallel Time: 36.4 ms, GC Workers: 28]
      [GC Worker Start (ms): Min: 125650196.3, Avg: 125650197.2, Max: 125650198.0, Diff: 1.8]
      [Ext Root Scanning (ms): Min: 2.8, Avg: 3.9, Max: 10.1, Diff: 7.3, Sum: 109.8]
      [Update RS (ms): Min: 15.4, Avg: 21.9, Max: 24.6, Diff: 9.2, Sum: 613.0]
         [Processed Buffers: Min: 33, Avg: 46.2, Max: 65, Diff: 32, Sum: 1294]
      [Scan RS (ms): Min: 0.2, Avg: 1.2, Max: 1.4, Diff: 1.2, Sum: 33.3]
      [Code Root Scanning (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.1]
      [Object Copy (ms): Min: 6.3, Avg: 7.7, Max: 7.9, Diff: 1.6, Sum: 215.2]
      [Termination (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.7]
         [Termination Attempts: Min: 1, Avg: 7.4, Max: 12, Diff: 11, Sum: 208]
      [GC Worker Other (ms): Min: 0.1, Avg: 0.3, Max: 0.4, Diff: 0.4, Sum: 7.5]
      [GC Worker Total (ms): Min: 34.1, Avg: 35.0, Max: 35.9, Diff: 1.8, Sum: 979.7]
      [GC Worker End (ms): Min: 125650232.0, Avg: 125650232.2, Max: 125650232.4, Diff: 0.4]
   [Code Root Fixup: 0.0 ms]
   [Code Root Purge: 0.0 ms]
   [Clear CT: 2.4 ms]
   [Other: 18.0 ms]
      [Choose CSet: 0.0 ms]
      [Ref Proc: 0.7 ms]
      [Ref Enq: 0.0 ms]
      [Redirty Cards: 0.6 ms]
      [Humongous Register: 2.2 ms]
      [Humongous Reclaim: 3.4 ms]
      [Free CSet: 7.3 ms]
   [Eden: 9788.0M(9788.0M)->0.0B(9776.0M) Survivors: 40.0M->52.0M Heap: 12.2G(16.0G)->1257.7M(16.0G)]
 [Times: user=0.93 sys=0.07, real=0.06 secs]

0 个答案:

没有答案