性能问答>YoungGC暂停长达28s,求大佬帮忙看看怎么回事>
9回复

YoungGC暂停长达28s,求大佬帮忙看看怎么回事



JVM参数:

CommandLine flags: -XX:CICompilerCount=4 -XX:CompressedClassSpaceSize=260046848 -XX:ConcGCThreads=8 -XX:G1MixedGCCountTarget=16 -XX:GCLogFileSize=33554432 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/logs/100016706 -XX:InitialHeapSize=12884901888 -XX:+ManagementServer -XX:MaxGCPauseMillis=1000 -XX:MaxHeapFreeRatio=50 -XX:MaxHeapSize=12884901888 -XX:MaxMetaspaceSize=268435456 -XX:MetaspaceSize=134217728 -XX:MinHeapFreeRatio=30 -XX:NumberOfGCLogFiles=5 -XX:-OmitStackTraceInFastThrow -XX:ParallelGCThreads=8 -XX:+ParallelRefProcEnabled -XX:+PreserveFramePointer -XX:+PrintGC -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:-ResizePLAB -XX:SoftRefLRUPolicyMSPerMB=0 -XX:ThreadStackSize=512 -XX:+UnlockExperimentalVMOptions -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseG1GC -XX:+UseGCLogFileRotation

GC日志:

2020-02-21T03:34:36.241+0800: 645775.554: [GC pause (G1 Evacuation Pause) (young) (to-space exhausted), 28.5642889 secs]
   [Parallel Time: 26867.3 ms, GC Workers: 8]
      [GC Worker Start (ms): Min: 645775554.7, Avg: 645775554.7, Max: 645775554.7, Diff: 0.1]
      [Ext Root Scanning (ms): Min: 2.0, Avg: 2.1, Max: 2.3, Diff: 0.3, Sum: 16.6]
      [Update RS (ms): Min: 84.2, Avg: 84.4, Max: 84.5, Diff: 0.3, Sum: 675.0]
         [Processed Buffers: Min: 498, Avg: 508.8, Max: 520, Diff: 22, Sum: 4070]
      [Scan RS (ms): Min: 11.9, Avg: 12.0, Max: 12.0, Diff: 0.1, Sum: 95.8]
      [Code Root Scanning (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.1]
      [Object Copy (ms): Min: 26768.4, Avg: 26768.4, Max: 26768.6, Diff: 0.3, Sum: 214147.5]
      [Termination (ms): Min: 0.0, Avg: 0.2, Max: 0.2, Diff: 0.2, Sum: 1.5]
         [Termination Attempts: Min: 1, Avg: 188.9, Max: 245, Diff: 244, Sum: 1511]
      [GC Worker Other (ms): Min: 0.0, Avg: 0.1, Max: 0.1, Diff: 0.1, Sum: 0.6]
      [GC Worker Total (ms): Min: 26867.1, Avg: 26867.1, Max: 26867.2, Diff: 0.1, Sum: 214937.0]
      [GC Worker End (ms): Min: 645802421.8, Avg: 645802421.8, Max: 645802421.9, Diff: 0.1]
   [Code Root Fixup: 0.0 ms]
   [Code Root Purge: 0.0 ms]
   [Clear CT: 0.6 ms]
   [Other: 1696.4 ms]
      [Evacuation Failure: 1671.9 ms]
      [Choose CSet: 0.0 ms]
      [Ref Proc: 11.2 ms]
      [Ref Enq: 0.2 ms]
      [Redirty Cards: 7.9 ms]
      [Humongous Register: 0.1 ms]
      [Humongous Reclaim: 1.7 ms]
      [Free CSet: 1.1 ms]
   [Eden: 6448.0M(6448.0M)->0.0B(2508.0M) Survivors: 924.0M->8192.0K Heap: 11.6G(12.0G)->8283.8M(12.0G)]
 [Times: user=30.75 sys=10.87, real=28.56 secs] 

貌似是to区不够,全部copy到old区了,Object Copy就花了26s,为什么拷贝会花那么久呢,这种一般怎么个优化法?

5235 阅读
请先登录,查看9条精彩评论吧
快去登录吧,你将获得
  • 浏览更多精彩评论
  • 和开发者讨论交流,共同进步