使用G1偶尔扫描RS花费很长时间

时间:2018-11-17 06:24:39

标签: jvm jvm-hotspot g1gc

使用G1的jvm在大多数情况下都能正常工作,但偶尔会花费较长的时间([Scan RS(ms):Min:4989.9,Avg:4994.8,Max:5006.3,Diff:16.3,Sum:39958.7])< / p>

可以更改任何选项来优化扫描RS时间吗?

jvm命令行

-Xss1m -XX:ErrorFile=/usr/local/xxx/jvm_error.log -server -Xms16g -Xmx16g -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=15 -XX:G1MaxNewSizePercent=35 -XX:+PrintFlagsFinal -XX:+PrintReferenceGC -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UnlockDiagnosticVMOptions -XX:+G1SummarizeConcMark -XX:ConcGCThreads=8 -XX:ParallelGCThreads=8 -XX:MaxGCPauseMillis=150 -XX:G1HeapWastePercent=20 -XX:+ParallelRefProcEnabled -XX:InitiatingHeapOccupancyPercent=70 -XX:G1HeapRegionSize=8m -Xloggc:/usr/local/xxx/gc.log -XX:-ReduceInitialCardMarks 

jinfo输出

Server compiler detected.
JVM version is 25.45-b02
Java System Properties:

com.sun.management.jmxremote.authenticate = false
java.runtime.name = Java(TM) SE Runtime Environment
java.vm.version = 25.45-b02
sun.boot.library.path = /usr/local/xxx/jdk1.8.0_45/jre/lib/amd64
java.vendor.url = http://java.oracle.com/
java.vm.vendor = Oracle Corporation
path.separator = :
java.rmi.server.randomIDs = true
file.encoding.pkg = sun.io
java.vm.name = Java HotSpot(TM) 64-Bit Server VM
sun.os.patch.level = unknown
sun.java.launcher = SUN_STANDARD
user.country = US
java.vm.specification.name = Java Virtual Machine Specification
com.sun.management.jmxremote.port = 5002
java.runtime.version = 1.8.0_45-b14
java.awt.graphicsenv = sun.awt.X11GraphicsEnvironment
os.arch = amd64
java.endorsed.dirs = /usr/local/xxx/jdk1.8.0_45/jre/lib/endorsed
line.separator = 

java.io.tmpdir = /tmp
java.vm.specification.vendor = Oracle Corporation
os.name = Linux
sun.jnu.encoding = UTF-8
java.specification.name = Java Platform API Specification
java.class.version = 52.0
sun.management.compiler = HotSpot 64-Bit Tiered Compilers
os.version = 3.10.104-1-tlinux2-0041.tl1
user.home = /usr/local/xxx
user.timezone = PRC
java.awt.printerjob = sun.print.PSPrinterJob
file.encoding = UTF-8
java.specification.version = 1.8

java.class.path = xxx
java.vm.specification.version = 1.8
sun.arch.data.model = 64
sun.java.command = xxx
java.home = /usr/local/xxx/jdk1.8.0_45/jre
user.language = en
java.specification.vendor = Oracle Corporation
awt.toolkit = sun.awt.X11.XToolkit
com.sun.management.jmxremote.ssl = false
java.vm.info = mixed mode
java.version = 1.8.0_45
java.ext.dirs = /usr/local/xxx/jdk1.8.0_45/jre/lib/ext:/usr/java/packages/lib/ext
sun.boot.class.path = xxx
java.vendor = Oracle Corporation
file.separator = /
java.vendor.url.bug = http://bugreport.sun.com/bugreport/
sun.io.unicode.encoding = UnicodeLittle
sun.cpu.endian = little
sun.cpu.isalist = 

GC日志(扫描RS时间在2018-11-16T07:54:19.442 + 0800处增加)

     [Times: user=3.16 sys=0.00, real=0.40 secs] 
2018-11-16T07:52:36.660+0800: 6705940.466: [GC pause (G1 Evacuation Pause) (young) (initial-mark)6705940.812: [SoftReference, 0 refs, 0.0003233 secs]6705940.812: [WeakReference, 2 refs, 0.0002399 secs]6705940.812: [FinalReference, 171 refs, 0.0001946 secs]6705940.812: [PhantomReference, 0 refs, 0 refs, 0.0003687 secs]6705940.813: [JNI Weak Reference, 0.0000142 secs], 0.3506144 secs]
   [Parallel Time: 344.4 ms, GC Workers: 8]
      [GC Worker Start (ms): Min: 6705940467.2, Avg: 6705940467.2, Max: 6705940467.3, Diff: 0.1]
      [Ext Root Scanning (ms): Min: 1.0, Avg: 1.0, Max: 1.2, Diff: 0.2, Sum: 8.3]
      [Update RS (ms): Min: 14.6, Avg: 14.8, Max: 15.0, Diff: 0.4, Sum: 118.0]
         [Processed Buffers: Min: 22, Avg: 31.8, Max: 67, Diff: 45, Sum: 254]
      [Scan RS (ms): Min: 305.7, Avg: 305.9, Max: 306.0, Diff: 0.3, Sum: 2447.3]
      [Code Root Scanning (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.0]
      [Object Copy (ms): Min: 22.0, Avg: 22.2, Max: 22.3, Diff: 0.3, Sum: 177.3]
      [Termination (ms): Min: 0.0, Avg: 0.2, Max: 0.2, Diff: 0.2, Sum: 1.3]
      [GC Worker Other (ms): Min: 0.0, Avg: 0.0, Max: 0.1, Diff: 0.1, Sum: 0.3]
      [GC Worker Total (ms): Min: 344.0, Avg: 344.1, Max: 344.1, Diff: 0.1, Sum: 2752.6]
      [GC Worker End (ms): Min: 6705940811.3, Avg: 6705940811.3, Max: 6705940811.3, Diff: 0.1]
   [Code Root Fixup: 0.1 ms]
   [Code Root Purge: 0.0 ms]
   [Clear CT: 1.0 ms]
   [Other: 5.2 ms]
      [Choose CSet: 0.0 ms]
      [Ref Proc: 1.3 ms]
      [Ref Enq: 0.1 ms]
      [Redirty Cards: 1.1 ms]
      [Humongous Reclaim: 0.0 ms]
      [Free CSet: 1.6 ms]
   [Eden: 2424.0M(2424.0M)->0.0B(2424.0M) Survivors: 32.0M->32.0M Heap: 13.5G(16.0G)->11.2G(16.0G)]
 [Times: user=2.80 sys=0.00, real=0.35 secs] 
2018-11-16T07:52:37.011+0800: 6705940.817: [GC concurrent-root-region-scan-start]
2018-11-16T07:52:37.046+0800: 6705940.853: [GC concurrent-root-region-scan-end, 0.0353443 secs]
2018-11-16T07:52:37.046+0800: 6705940.853: [GC concurrent-mark-start]
2018-11-16T07:52:42.007+0800: 6705945.813: [GC concurrent-mark-end, 4.9605298 secs]
2018-11-16T07:52:42.009+0800: 6705945.815: [GC remark 6705945.815: [Finalize Marking, 0.0005259 secs] 6705945.816: [GC ref-proc6705945.816: [SoftReference, 88 refs, 0.0002698 secs]6705945.816: [WeakReference, 302 refs, 0.0002114 secs]6705945.816: [FinalReference, 2068 refs, 0.0010914 secs]6705945.817: [PhantomReference, 0 refs, 16 refs, 0.0003421 secs]6705945.818: [JNI Weak Reference, 0.0000552 secs], 0.0023971 secs] 6705945.818: [Unloading, 0.0063063 secs], 0.1153675 secs]
 [Times: user=0.91 sys=0.00, real=0.11 secs] 
2018-11-16T07:52:42.127+0800: 6705945.934: [GC cleanup 11G->11G(16G), 0.3453918 secs]
 [Times: user=2.77 sys=0.00, real=0.34 secs] 
2018-11-16T07:53:27.785+0800: 6705991.592: [GC pause (G1 Evacuation Pause) (young)6705992.024: [SoftReference, 0 refs, 0.0003114 secs]6705992.024: [WeakReference, 4 refs, 0.0001959 secs]6705992.025: [FinalReference, 217 refs, 0.0002370 secs]6705992.025: [PhantomReference, 0 refs, 0 refs, 0.0003876 secs]6705992.025: [JNI Weak Reference, 0.0000352 secs], 0.4375653 secs]
   [Parallel Time: 431.5 ms, GC Workers: 8]
      [GC Worker Start (ms): Min: 6705991592.4, Avg: 6705991592.5, Max: 6705991592.5, Diff: 0.1]
      [Ext Root Scanning (ms): Min: 0.8, Avg: 0.9, Max: 0.9, Diff: 0.1, Sum: 6.8]
      [Update RS (ms): Min: 17.7, Avg: 17.8, Max: 18.3, Diff: 0.6, Sum: 142.8]
         [Processed Buffers: Min: 19, Avg: 33.9, Max: 49, Diff: 30, Sum: 271]
      [Scan RS (ms): Min: 369.2, Avg: 369.6, Max: 369.8, Diff: 0.6, Sum: 2957.1]
      [Code Root Scanning (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.0]
      [Object Copy (ms): Min: 42.4, Avg: 42.5, Max: 43.1, Diff: 0.7, Sum: 340.1]
      [Termination (ms): Min: 0.0, Avg: 0.6, Max: 0.7, Diff: 0.7, Sum: 4.5]
      [GC Worker Other (ms): Min: 0.0, Avg: 0.0, Max: 0.1, Diff: 0.0, Sum: 0.3]
      [GC Worker Total (ms): Min: 431.4, Avg: 431.4, Max: 431.5, Diff: 0.1, Sum: 3451.6]
      [GC Worker End (ms): Min: 6705992023.9, Avg: 6705992023.9, Max: 6705992023.9, Diff: 0.0]
   [Code Root Fixup: 0.1 ms]
   [Code Root Purge: 0.0 ms]
   [Clear CT: 1.1 ms]
   [Other: 4.9 ms]
      [Choose CSet: 0.0 ms]
      [Ref Proc: 1.3 ms]
      [Ref Enq: 0.1 ms]
      [Redirty Cards: 1.1 ms]
      [Humongous Reclaim: 0.0 ms]
      [Free CSet: 1.6 ms]
   [Eden: 2424.0M(2424.0M)->0.0B(2424.0M) Survivors: 32.0M->32.0M Heap: 13.5G(16.0G)->11.2G(16.0G)]
 [Times: user=3.51 sys=0.00, real=0.44 secs] 
2018-11-16T07:54:19.442+0800: 6706043.249: [GC pause (G1 Evacuation Pause) (mixed)6706048.747: [SoftReference, 0 refs, 0.0003203 secs]6706048.747: [WeakReference, 0 refs, 0.0001715 secs]6706048.747: [FinalReference, 158 refs, 0.0002620 secs]6706048.747: [PhantomReference, 0 refs, 0 refs, 0.0003442 secs]6706048.748: [JNI Weak Reference, 0.0000194 secs], 5.5439976 secs]
   [Parallel Time: 5465.8 ms, GC Workers: 8]
      [GC Worker Start (ms): Min: 6706043280.7, Avg: 6706043280.8, Max: 6706043280.8, Diff: 0.1]
      [Ext Root Scanning (ms): Min: 0.7, Avg: 0.8, Max: 1.2, Diff: 0.5, Sum: 6.6]
      [Update RS (ms): Min: 12.5, Avg: 12.8, Max: 12.9, Diff: 0.4, Sum: 102.2]
         [Processed Buffers: Min: 20, Avg: 30.9, Max: 85, Diff: 65, Sum: 247]
      [Scan RS (ms): Min: 4989.9, Avg: 4994.8, Max: 5006.3, Diff: 16.3, Sum: 39958.7]
      [Code Root Scanning (ms): Min: 0.0, Avg: 0.0, Max: 0.1, Diff: 0.1, Sum: 0.3]
      [Object Copy (ms): Min: 410.2, Avg: 426.1, Max: 461.9, Diff: 51.7, Sum: 3408.9]
      [Termination (ms): Min: 0.0, Avg: 31.0, Max: 35.7, Diff: 35.7, Sum: 248.2]
      [GC Worker Other (ms): Min: 0.0, Avg: 0.0, Max: 0.1, Diff: 0.1, Sum: 0.3]
      [GC Worker Total (ms): Min: 5465.6, Avg: 5465.6, Max: 5465.7, Diff: 0.1, Sum: 43725.1]
      [GC Worker End (ms): Min: 6706048746.4, Avg: 6706048746.4, Max: 6706048746.4, Diff: 0.1]
   [Code Root Fixup: 0.1 ms]
   [Code Root Purge: 0.0 ms]
   [Clear CT: 1.0 ms]
   [Other: 77.1 ms]
      [Choose CSet: 31.2 ms]
      [Ref Proc: 1.3 ms]
      [Ref Enq: 0.1 ms]
      [Redirty Cards: 10.2 ms]
      [Humongous Reclaim: 0.0 ms]
      [Free CSet: 33.5 ms]
   [Eden: 2424.0M(2424.0M)->0.0B(2424.0M) Survivors: 32.0M->32.0M Heap: 13.5G(16.0G)->10.3G(16.0G)]
 [Times: user=44.35 sys=0.00, real=5.55 secs] 
2018-11-16T07:55:14.726+0800: 6706098.533: [GC pause (G1 Evacuation Pause) (mixed)6706105.154: [SoftReference, 0 refs, 0.0002975 secs]6706105.154: [WeakReference, 0 refs, 0.0001962 secs]6706105.154: [FinalReference, 132 refs, 0.0002233 secs]6706105.155: [PhantomReference, 0 refs, 0 refs, 0.0003446 secs]6706105.155: [JNI Weak Reference, 0.0000171 secs], 6.6696695 secs]
   [Parallel Time: 6586.2 ms, GC Workers: 8]
      [GC Worker Start (ms): Min: 6706098567.4, Avg: 6706098567.5, Max: 6706098567.5, Diff: 0.1]
      [Ext Root Scanning (ms): Min: 0.8, Avg: 0.9, Max: 1.3, Diff: 0.5, Sum: 7.0]
      [Update RS (ms): Min: 12.2, Avg: 12.6, Max: 12.9, Diff: 0.7, Sum: 101.2]
         [Processed Buffers: Min: 21, Avg: 30.9, Max: 49, Diff: 28, Sum: 247]
      [Scan RS (ms): Min: 5767.0, Avg: 5787.1, Max: 5795.8, Diff: 28.8, Sum: 46296.4]
      [Code Root Scanning (ms): Min: 0.0, Avg: 0.1, Max: 0.3, Diff: 0.3, Sum: 0.4]
      [Object Copy (ms): Min: 575.3, Avg: 609.3, Max: 782.7, Diff: 207.5, Sum: 4874.4]
      [Termination (ms): Min: 0.0, Avg: 176.1, Max: 201.4, Diff: 201.3, Sum: 1409.0]
      [GC Worker Other (ms): Min: 0.0, Avg: 0.0, Max: 0.1, Diff: 0.0, Sum: 0.3]
      [GC Worker Total (ms): Min: 6586.1, Avg: 6586.1, Max: 6586.1, Diff: 0.0, Sum: 52688.6]
      [GC Worker End (ms): Min: 6706105153.5, Avg: 6706105153.6, Max: 6706105153.6, Diff: 0.0]
   [Code Root Fixup: 0.1 ms]
   [Code Root Purge: 0.0 ms]
   [Clear CT: 1.0 ms]
   [Other: 82.4 ms]
      [Choose CSet: 34.0 ms]
      [Ref Proc: 1.2 ms]
      [Ref Enq: 0.1 ms]
      [Redirty Cards: 12.4 ms]
      [Humongous Reclaim: 0.0 ms]
      [Free CSet: 33.8 ms]
   [Eden: 2424.0M(2424.0M)->0.0B(2424.0M) Survivors: 32.0M->32.0M Heap: 12.7G(16.0G)->9920.6M(16.0G)]
 [Times: user=53.39 sys=0.00, real=6.66 secs] 
2018-11-16T07:56:10.064+0800: 6706153.870: [GC pause (G1 Evacuation Pause) (mixed)6706156.501: [SoftReference, 0 refs, 0.0003236 secs]6706156.501: [WeakReference, 2 refs, 0.0001976 secs]6706156.502: [FinalReference, 133 refs, 0.0002196 secs]6706156.502: [PhantomReference, 0 refs, 0 refs, 0.0003482 secs]6706156.502: [JNI Weak Reference, 0.0000205 secs], 2.6424790 secs]
   [Parallel Time: 2626.5 ms, GC Workers: 8]
      [GC Worker Start (ms): Min: 6706153874.2, Avg: 6706153874.3, Max: 6706153874.3, Diff: 0.1]
      [Ext Root Scanning (ms): Min: 0.8, Avg: 0.8, Max: 0.9, Diff: 0.1, Sum: 6.5]
      [Update RS (ms): Min: 16.1, Avg: 16.2, Max: 16.3, Diff: 0.3, Sum: 129.2]
         [Processed Buffers: Min: 22, Avg: 32.0, Max: 83, Diff: 61, Sum: 256]
      [Scan RS (ms): Min: 2489.9, Avg: 2502.5, Max: 2508.9, Diff: 19.0, Sum: 20020.1]
      [Code Root Scanning (ms): Min: 0.0, Avg: 0.0, Max: 0.1, Diff: 0.1, Sum: 0.1]
      [Object Copy (ms): Min: 99.8, Avg: 106.4, Max: 119.1, Diff: 19.3, Sum: 851.2]
      [Termination (ms): Min: 0.0, Avg: 0.5, Max: 0.7, Diff: 0.7, Sum: 4.0]
      [GC Worker Other (ms): Min: 0.0, Avg: 0.0, Max: 0.1, Diff: 0.1, Sum: 0.4]
      [GC Worker Total (ms): Min: 2626.4, Avg: 2626.4, Max: 2626.5, Diff: 0.1, Sum: 21011.5]
      [GC Worker End (ms): Min: 6706156500.7, Avg: 6706156500.7, Max: 6706156500.7, Diff: 0.1]
   [Code Root Fixup: 0.1 ms]
   [Code Root Purge: 0.0 ms]
   [Clear CT: 1.2 ms]
   [Other: 14.7 ms]
      [Choose CSet: 3.3 ms]
      [Ref Proc: 1.3 ms]
      [Ref Enq: 0.1 ms]
      [Redirty Cards: 4.2 ms]
      [Humongous Reclaim: 0.0 ms]
      [Free CSet: 4.9 ms]
   [Eden: 2424.0M(2424.0M)->0.0B(2424.0M) Survivors: 32.0M->32.0M Heap: 12.1G(16.0G)->9883.9M(16.0G)]
 [Times: user=21.28 sys=0.00, real=2.65 secs] 
2018-11-16T07:57:02.462+0800: 6706206.268: [GC pause (G1 Evacuation Pause) (young)6706206.352: [SoftReference, 0 refs, 0.0003257 secs]6706206.352: [WeakReference, 4 refs, 0.0001590 secs]6706206.353: [FinalReference, 261 refs, 0.0002023 secs]6706206.353: [PhantomReference, 0 refs, 0 refs, 0.0003479 secs]6706206.353: [JNI Weak Reference, 0.0000161 secs], 0.0890372 secs]
   [Parallel Time: 83.2 ms, GC Workers: 8]
      [GC Worker Start (ms): Min: 6706206268.6, Avg: 6706206268.7, Max: 6706206268.7, Diff: 0.1]
      [Ext Root Scanning (ms): Min: 0.8, Avg: 0.8, Max: 0.9, Diff: 0.1, Sum: 6.7]
      [Update RS (ms): Min: 15.1, Avg: 15.2, Max: 15.4, Diff: 0.3, Sum: 121.3]
         [Processed Buffers: Min: 22, Avg: 30.2, Max: 56, Diff: 34, Sum: 242]
      [Scan RS (ms): Min: 53.1, Avg: 53.3, Max: 53.4, Diff: 0.3, Sum: 426.6]
      [Code Root Scanning (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.0]
      [Object Copy (ms): Min: 13.7, Avg: 13.7, Max: 13.8, Diff: 0.1, Sum: 109.9]
      [Termination (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.1]
      [GC Worker Other (ms): Min: 0.0, Avg: 0.0, Max: 0.1, Diff: 0.0, Sum: 0.3]
      [GC Worker Total (ms): Min: 83.1, Avg: 83.1, Max: 83.2, Diff: 0.1, Sum: 664.8]
      [GC Worker End (ms): Min: 6706206351.8, Avg: 6706206351.8, Max: 6706206351.8, Diff: 0.0]
   [Code Root Fixup: 0.1 ms]
   [Code Root Purge: 0.0 ms]
   [Clear CT: 0.9 ms]
   [Other: 4.8 ms]
      [Choose CSet: 0.0 ms]
      [Ref Proc: 1.2 ms]
      [Ref Enq: 0.1 ms]
      [Redirty Cards: 1.0 ms]
      [Humongous Reclaim: 0.0 ms]
      [Free CSet: 1.7 ms]
   [Eden: 2424.0M(2424.0M)->0.0B(2424.0M) Survivors: 32.0M->32.0M Heap: 12.0G(16.0G)->9918.9M(16.0G)]
 [Times: user=0.69 sys=0.00, real=0.09 secs] 
2018-11-16T07:57:53.995+0800: 6706257.802: [GC pause (G1 Evacuation Pause) (young)6706257.884: [SoftReference, 0 refs, 0.0003182 secs]6706257.885: [WeakReference, 2 refs, 0.0001466 secs]6706257.885: [FinalReference, 258 refs, 0.0002163 secs]6706257.885: [PhantomReference, 0 refs, 0 refs, 0.0003126 secs]6706257.885: [JNI Weak Reference, 0.0000166 secs], 0.0876269 secs]
   [Parallel Time: 81.9 ms, GC Workers: 8]
      [GC Worker Start (ms): Min: 6706257802.3, Avg: 6706257802.3, Max: 6706257802.4, Diff: 0.1]
      [Ext Root Scanning (ms): Min: 0.7, Avg: 0.8, Max: 0.8, Diff: 0.1, Sum: 6.3]
      [Update RS (ms): Min: 14.7, Avg: 14.7, Max: 14.9, Diff: 0.3, Sum: 117.9]
         [Processed Buffers: Min: 21, Avg: 29.6, Max: 57, Diff: 36, Sum: 237]
      [Scan RS (ms): Min: 52.3, Avg: 52.4, Max: 52.5, Diff: 0.2, Sum: 419.5]
      [Code Root Scanning (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.0]
      [Object Copy (ms): Min: 13.7, Avg: 13.8, Max: 13.8, Diff: 0.1, Sum: 110.1]
      [Termination (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.2]
      [GC Worker Other (ms): Min: 0.0, Avg: 0.0, Max: 0.1, Diff: 0.1, Sum: 0.3]
      [GC Worker Total (ms): Min: 81.7, Avg: 81.8, Max: 81.8, Diff: 0.1, Sum: 654.3]
      [GC Worker End (ms): Min: 6706257884.1, Avg: 6706257884.1, Max: 6706257884.1, Diff: 0.0]
   [Code Root Fixup: 0.1 ms]
   [Code Root Purge: 0.0 ms]
   [Clear CT: 0.9 ms]
   [Other: 4.7 ms]
      [Choose CSet: 0.0 ms]
      [Ref Proc: 1.2 ms]
      [Ref Enq: 0.1 ms]
      [Redirty Cards: 1.0 ms]
      [Humongous Reclaim: 0.0 ms]
      [Free CSet: 1.6 ms]
   [Eden: 2424.0M(2424.0M)->0.0B(2424.0M) Survivors: 32.0M->32.0M Heap: 12.1G(16.0G)->9953.0M(16.0G)]
 [Times: user=0.67 sys=0.00, real=0.09 secs] 

0 个答案:

没有答案