Garbage First Collector, 簡稱G1 Collector,是HotspotJDK1.7後提供的面向大內存(Heap區數G到數10G)、多核系統的收集器,可以實現軟停頓目標收集而且具備高吞吐量, 具備更可預測的停頓時間。一些基本的垃圾收集的概念和術語能夠參考我以前的一篇理解GC(垃圾回收算法和原理)。html
G1是一種併發、並行、部分Stop The World、使用Copying算法收集的分代的增量式收集器,
G1的全堆的操做,像global marking,是和應用(mutator)併發執行的,這樣能夠減小對mutator的暫停時間。清除階段則使用多線程來提升吞吐量。
與Hotspot以前的Serial、Parallel、CMS等收集器不一樣的是,G1將堆分爲不少大小相等的Region, 每次收集時會判斷各個Region的活性-即垃圾對象的佔比,垃圾對象佔比越多的Region回收的收益越大,而後G1會按照設置的停頓時間目標、前幾回回收Region所用時間來估算要回收哪些Region,即用最小的時間獲取最大的收益,這也是Garbage First名字的含義。
Garbage First Collector的使命是在將來替換CMS,而且在JDK1.9已經成爲默認的收集器。java
Hotspot以前已經攜帶了Serial, Paralel, CMS等收集器,爲何還須要研發一個新的G1呢?垃圾收集的三個性能指標: footprint, max pause time, throughput彷佛像CAP同樣不能同時知足。
在服務端更注重的是短停頓時間,也就是stop-the-world的時間,另一段時間內的總停頓時間也是一個衡量指標。
Mark-Sweep, Mark-Compact均須要和清理區域大小成比例的工做量,而Copying算法則須要通常是一半的空間用於存放每次copy的活對象。CMS的Initial Marking和Remarking兩個STW階段在Heap區愈來愈大的狀況下須要的時間越長,而且因爲內存碎片,須要壓縮的話也會形成較長停頓時間。因此須要一種高吞吐量的短暫停時間的收集器,而無論堆內存多大。linux
避免長暫停時間,能夠考慮將堆分紅多個部分,一次收集其中一部分,這樣的方式又叫作增量收集(incremental collection), 分代收集也能夠當作一種特殊的增量收集。
G1收集器將堆內存劃分爲一系列大小相等的Region區域,Region大小在1MB到32MB在啓動時肯定,G1一樣也使用分代收集策略,將堆分爲Eden, Survivior, Old等,只不過是按照邏輯劃分的,每一個Region邏輯上屬於一個分代區域,而且在物理上不連續,當一個Old的Region收集完成後會變成新可用Region並可能成爲下一個Eden Region。當申請的對象大於Region大小的一半時,會被放入一個Humongous Region(巨型區域)中。當一個Region中是空的時,稱爲可用Region或新Region。
圖片中E指Eden, S是Survivor, H指Humongous, O是Old, 空白區域是可用分區。git
由於G1只回收一部分Region, 因此回收的時候須要知道哪些其餘Region的對象引用着本身Region的對象,由於採用的copying算法須要移動對象,因此要更新引用爲對象的新地址,在普通的分代收集中也是如此,分代收集中年輕代收集須要老年代到年輕代的引用的記錄,一般叫作remembered set(簡稱RS)。CardTable是一種remembered set, 一個card表明一個範圍的內存,目前採用512bytes表示一個card,cardtable就是一個byte數組,每一個Region有本身的cardtable。維護remembered set須要mutator線程在可能修改跨Region的引用的時候通知collector, 這種方式一般叫作write barrier(和GC中的Memory Barrier不一樣), 每一個線程都會有本身的remembered set log,至關於各自的修改的card的緩衝buffer,除此以外還有全局的buffer, mutator本身的remember set buffer滿了以後會放入到全局buffer中,而後建立一個新的buffer。
只有來自其餘Region的引用須要記錄在RS中,因此Region內部的引用和null都不須要記錄RS。github
G1收集器的標記階段負責標記處存活的對象、而且計算各個Region的活躍度等。
G1使用了一種Snaphot-At-The-Beginning簡稱SATB的標記算法, 記錄標記開始時的對象圖的快照,以後併發收集過程當中的新申請的對象都認爲是存活對象, 當堆使用比例超過InitiatingHeapOccupancyPercent後開始marking階段,使用SATB記錄marking開始階段的對象圖快照,。
G1使用bitmap標記處哪些位置已經完成標記了,一個bitmap的bit表示8bytes, 咱們使用兩個marking bitmap,一個previous、一個next, previous marking bitmap表示已經完成標記的部分,標記完成後會交換previous和next
標記階段分爲幾個步驟。算法
標記週期的最開始是清除next marking bitmap,是併發執行的。而後開始initial marking phase, 會暫停全部線程,標記出全部能夠直接從GC roots能夠到達的對象,這是在Young GC的暫停收集階段順帶進行的。數組
找出全部的GC Roots的Region, 而後從這些Region開始標記可到達的對象,是一個併發階段。多線程
這個階段G1經過tracing找出整個堆全部的可到達的對象。這個階段是併發執行的。併發
Remark是一個STW階段,G1將全部的SATB buffer處理完成。oracle
marking的最後一個階段,G1統計各個Region的活躍性,徹底沒有存活對象的Region直接放入空閒可用Region列表中,而後會找出mixed GC的Region候選列表。
和通常的分代式收集不一樣,G1中除了普通的Young GC,還有Mixed GC。
當Eden區域沒法申請新的對象時(滿了),就會進行Young GC, Young GC將Eden和Survivor區域的Region(稱爲Collection Set, CSet)中的活對象Copy到一些新Region中(即新的Survivor),當對象的GC年齡達到閾值後會Copy到Old Region中。因爲採起的是Copying算法,因此就避免了內存碎片的問題,再也不須要單獨的壓縮。
當old區Heap的對象佔總Heap的比例超過InitiatingHeapOccupancyPercent以後,就會開始ConcurentMarking, 完成了Concurrent Marking後,G1會從Young GC切換到Mixed GC, 在Mixed GC中,G1能夠增長若干個Old區域的Region到CSet中。
Mixed GC的次數根據候選的Old CSet和每次回收的
和CMS同樣,G1的一些收集過程是和應用程序併發執行的,因此可能尚未回收完成,是因爲申請內存的速度比回收速度快,新的對象就佔滿了全部空間,在CMS中叫作Concurrent Mode Failure, 在G1中稱爲Allocation Failure,也會降級爲一個STW的fullgc。
G1使用一種Snapshot-At-The-Begining的方式記錄活對象,也就是那一時刻(整個堆concurrent marking開始的時候)的內存的Object graph, 可是在以後這裏面的對象可能會變成Garbage, 叫作floating garbage 只能等到下一次收集回收掉。
G1的特色有,將Heap分爲大小相等的Region,邏輯分代,Marking的大部分是併發的,STW中大部分採起多線程並行執行,採用Copying進行多線程並行收集。
1 |
-Xmx -Xms |
和其餘收集器同樣,是配置堆的最大大小和初始大小
1 |
-XX:MaxGCPauseMillis=200 |
GC最大暫停時間,默認200ms
1 |
-XX:InitiatingHeapOccupancyPercent=45 |
開始一個標記週期的堆佔用比例閾值,默認45%,注意這裏是整個堆,不一樣於CMS中的Old堆比例。
1 |
-XX:G1HeapRegionSize=n |
設置每一個Region的大小,這裏須要是1MB到32MB的2的指數的大小。
我的認爲更換GC或者進行調優只能算是系統的錦上添花,並不能做爲主要解決系統性能問題的關鍵,出現內存問題時,應當以修改應用代碼爲主、編寫清晰的GC友好的代碼,選擇與應用場景合適的收集器能夠提升系統的性能。
如今推薦從CMS更換到G1的一些狀況以下:
在JDK1.8上從CMS切換到G1, 只須要更換啓動參數便可。
1 |
-XX:+UseG1GC |
從gc監控和gc日誌來看,沒有明顯大的變化,整體上出現的Full gc更少了。下面是一段GC日誌。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
// JVM、機器等信息 Java HotSpot(TM) 64-Bit Server VM (25.45-b02) for linux-amd64 JRE (1.8.0_45-b14), built on Apr 10 2015 10:07:45 by "java_re" with gcc 4.3.0 20080428 (Red Hat 4.3.0-8) // 內存信息 Memory: 4k page, physical 8059416k(2486228k free), swap 2096440k(2096440k free) // 啓動時參數 CommandLine flags: -XX:+DisableExplicitGC -XX:ErrorFile=/xxx/xxx -XX:G1LogLevel=finest -XX:+G1PrintRegionLivenessInfo -XX:+G1SummarizeConcMark -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/xxx/logs/xxxx/xxxx.heaperr.log.201706051331 -XX:InitialHeapSize=128950656 -XX:MaxHeapSize=2063210496 -XX:+PrintAdaptiveSizePolicy -XX:+PrintFlagsFinal -XX:+PrintGC -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC -XX:+PrintTenuringDistribution -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseG1GC // 由於啓動參數中Xms和Xmx不相等,因此G1根據其餘參數判斷須要進行擴容,進行了heap擴容 0.038: [G1Ergonomics (Heap Sizing) expand the heap, requested expansion amount: 130023424 bytes, attempted expansion amount: 130023424 bytes] 2017-06-05T13:31:19.764+0800: 0.779: Application time: 0.4628680 seconds 2017-06-05T13:31:19.764+0800: 0.779: Total time for which application threads were stopped: 0.0001855 seconds, Stopping threads took: 0.0000637 seconds 2017-06-05T13:31:19.892+0800: 0.907: Application time: 0.1276311 seconds 2017-06-05T13:31:19.892+0800: 0.907: Total time for which application threads were stopped: 0.0001424 seconds, Stopping threads took: 0.0000359 seconds 2017-06-05T13:31:20.176+0800: 1.191: Application time: 0.2839383 seconds // GC前打印的Heap信息 {Heap before GC invocations=0 (full 0): garbage-first heap total 126976K, used 14336K [0x0000000085000000, 0x00000000851003e0, 0x0000000100000000) region size 1024K, 14 young (14336K), 0 survivors (0K) Metaspace used 8432K, capacity 8590K, committed 8704K, reserved 1056768K class space used 899K, capacity 921K, committed 1024K, reserved 1048576K // Young GC的清理暫停 2017-06-05T13:31:20.176+0800: 1.191: [GC pause (G1 Evacuation Pause) (young) Desired survivor size 1048576 bytes, new threshold 15 (max 15) // 選擇要Collect的Region, 構成Collection Set,CSet 1.191: [G1Ergonomics (CSet Construction) start choosing CSet, _pending_cards: 0, predicted base time: 10.00 ms, remaining time: 190.00 ms, target pause time: 200.00 ms] // 選擇了 14個Eden, 0個Survivor 1.191: [G1Ergonomics (CSet Construction) add young regions to CSet, eden: 14 regions, survivors: 0 regions, predicted young region time: 356.52 ms] 1.191: [G1Ergonomics (CSet Construction) finish choosing CSet, eden: 14 regions, survivors: 0 regions, old: 0 regions, predicted pause time: 366.52 ms, target pause time: 200.00 ms] , 0.0055898 secs] [Parallel Time: 4.2 ms, GC Workers: 4] [GC Worker Start (ms): 1191.5 1191.5 1193.8 1195.6 Min: 1191.5, Avg: 1193.1, Max: 1195.6, Diff: 4.2] [Ext Root Scanning (ms): 1.3 1.3 0.0 0.0 Min: 0.0, Avg: 0.7, Max: 1.3, Diff: 1.3, Sum: 2.6] [Update RS (ms): 0.0 0.0 0.0 0.0 Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.0] [Processed Buffers: 0 0 0 0 Min: 0, Avg: 0.0, Max: 0, Diff: 0, Sum: 0] [Scan RS (ms): 0.0 0.0 0.0 0.0 Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.0] [Code Root Scanning (ms): 0.4 0.1 0.0 0.0 Min: 0.0, Avg: 0.1, Max: 0.4, Diff: 0.4, Sum: 0.5] [Object Copy (ms): 2.4 2.7 1.7 0.0 Min: 0.0, Avg: 1.7, Max: 2.7, Diff: 2.7, Sum: 6.7] [Termination (ms): 0.1 0.1 0.1 0.0 Min: 0.0, Avg: 0.1, Max: 0.1, Diff: 0.1, Sum: 0.3] [Termination Attempts: 1 3 1 1 Min: 1, Avg: 1.5, Max: 3, Diff: 2, Sum: 6] [GC Worker Other (ms): 0.0 0.0 0.0 0.0 Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.1] [GC Worker Total (ms): 4.2 4.2 1.8 0.0 Min: 0.0, Avg: 2.5, Max: 4.2, Diff: 4.2, Sum: 10.2] [GC Worker End (ms): 1195.6 1195.6 1195.6 1195.6 Min: 1195.6, Avg: 1195.6, Max: 1195.6, Diff: 0.0] [Code Root Fixup: 0.1 ms] [Code Root Purge: 0.0 ms] [Clear CT: 0.1 ms] [Clear CT: 0.1 ms] [Other: 1.1 ms] [Choose CSet: 0.0 ms] [Ref Proc: 0.8 ms] [Ref Enq: 0.0 ms] [Redirty Cards: 0.1 ms] [Parallel Redirty: 0.0 0.0 0.0 0.0 Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.0] [Redirtied Cards: 885 0 0 0 Min: 0, Avg: 221.2, Max: 885, Diff: 885, Sum: 885] [Humongous Reclaim: 0.0 ms] [Humongous Total: 0] [Humongous Candidate: 0] [Humongous Reclaimed: 0] [Free CSet: 0.0 ms] [Young Free CSet: 0.0 ms] [Non-Young Free CSet: 0.0 ms] [Eden: 14.0M(14.0M)->0.0B(18.0M) Survivors: 0.0B->2048.0K Heap: 14.0M(124.0M)->4016.5K(124.0M)] Heap after GC invocations=1 (full 0): garbage-first heap total 126976K, used 4016K [0x0000000085000000, 0x00000000851003e0, 0x0000000100000000) region size 1024K, 2 young (2048K), 2 survivors (2048K) Metaspace used 8432K, capacity 8590K, committed 8704K, reserved 1056768K class space used 899K, capacity 921K, committed 1024K, reserved 1048576K } [Times: user=0.01 sys=0.00, real=0.00 secs] 2017-06-05T13:31:20.182+0800: 1.197: Total time for which application threads were stopped: 0.0059362 seconds, Stopping threads took: 0.0000589 seconds // G1 請求開始併發標記週期, 緣由是內存佔用比例超過了閾值 [G1Ergonomics (Concurrent Cycles) request concurrent cycle initiation, reason: occupancy higher than threshold, occupancy: 63963136 bytes, allocation request: 0 bytes, threshold: 58510530 bytes (45.00 %), source: end of GC] , 0.0152145 secs] [Parallel Time: 10.3 ms, GC Workers: 4] [GC Worker Start (ms): 5509.1 5509.1 5514.1 5519.3 Min: 5509.1, Avg: 5512.9, Max: 5519.3, Diff: 10.2] [Ext Root Scanning (ms): 0.4 0.3 0.0 0.0 Min: 0.0, Avg: 0.2, Max: 0.4, Diff: 0.4, Sum: 0.7] [Update RS (ms): 1.5 1.8 0.0 0.0 Min: 0.0, Avg: 0.8, Max: 1.8, Diff: 1.8, Sum: 3.3] [Processed Buffers: 9 6 0 0 Min: 0, Avg: 3.8, Max: 9, Diff: 9, Sum: 15] [Scan RS (ms): 0.6 0.3 0.0 0.0 Min: 0.0, Avg: 0.2, Max: 0.6, Diff: 0.6, Sum: 0.9] [Code Root Scanning (ms): 0.0 0.0 0.0 0.0 Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.0] [Object Copy (ms): 2.5 2.4 0.0 0.0 Min: 0.0, Avg: 1.2, Max: 2.5, Diff: 2.5, Sum: 4.9] [Termination (ms): 5.3 5.3 5.2 0.0 Min: 0.0, Avg: 3.9, Max: 5.3, Diff: 5.3, Sum: 15.7] [Termination Attempts: 1 1 1 1 Min: 1, Avg: 1.0, Max: 1, Diff: 0, Sum: 4] [GC Worker Other (ms): 0.0 0.0 0.0 0.0 Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.0] [GC Worker Total (ms): 10.2 10.2 5.2 0.0 ... // 開始併發週期 5.696: [G1Ergonomics (Concurrent Cycles) initiate concurrent cycle, reason: concurrent cycle initiation requested] // Young GC中順帶執行的initial-mark 2017-06-05T11:26:22.512+0800: 5.696: [GC pause (G1 Evacuation Pause) (young) (initial-mark) ... // root region scan 2017-06-05T11:26:22.538+0800: 5.722: [GC concurrent-root-region-scan-start] 2017-06-05T11:26:22.540+0800: 5.724: [GC concurrent-root-region-scan-end, 0.0015848 secs] // concurrent mark 2017-06-05T11:26:22.540+0800: 5.724: [GC concurrent-mark-start] 2017-06-05T11:26:22.540+0800: 5.724: Total time for which application threads were stopped: 0.0281922 seconds, Stopping threads took: 0.0000381 seconds 2017-06-05T11:26:22.582+0800: 5.766: [GC concurrent-mark-end, 0.0416350 secs] 2017-06-05T11:26:22.582+0800: 5.766: Application time: 0.0417029 seconds // remark 2017-06-05T11:26:22.582+0800: 5.766: [GC remark 5.766: [Finalize Marking, 0.0002957 secs] 5.766: [GC ref-proc, 0.0039387 secs] 5.770: [Unloading 5.770: [System Dictionary Unloading, 0.0000263 secs] 5.770: [Parallel Unloading, 0.0046529 secs] 5.775: [Deallocate Metadata, 0.0000266 secs], 0.0049240 secs], 0.0094765 secs] [Times: user=0.03 sys=0.00, real=0.01 secs] 2017-06-05T11:26:22.591+0800: 5.775: Total time for which application threads were stopped: 0.0096170 seconds, Stopping threads took: 0.0000400 seconds 2017-06-05T11:26:22.592+0800: 5.776: Application time: 0.0004581 seconds // cleanup 2017-06-05T11:26:22.592+0800: 5.776: [GC cleanup // 統計出了各個Region的收集效率 ### PHASE Post-Marking @ 5.776 ### HEAP reserved: 0x0000000085000000-0x0000000100000000 region-size: 1048576 ### ### type address-range used prev-live next-live gc-eff remset code-roots ### (bytes) (bytes) (bytes) (bytes/ms) (bytes) (bytes) ### OLD 0x0000000085000000-0x0000000085100000 1048576 1048576 245296 0.0 4216 408 ### OLD 0x0000000085100000-0x0000000085200000 1048576 1048576 154904 0.0 21376 5424 ### OLD 0x0000000085200000-0x0000000085300000 1048576 1048576 1024728 0.0 30904 8520 ### OLD 0x0000000085300000-0x0000000085400000 1048576 1048576 669968 0.0 5072 576 ### OLD 0x0000000085400000-0x0000000085500000 1048576 1048576 6888 0.0 3136 16 ### OLD 0x0000000085500000-0x0000000085600000 1048576 1048576 0 0.0 3136 16 ### OLD 0x0000000085600000-0x0000000085700000 1048576 1048576 0 0.0 3136 16 ### OLD 0x0000000085700000-0x0000000085800000 1048576 1048576 0 0.0 3136 16 ### OLD 0x0000000085800000-0x0000000085900000 1048576 1048576 0 0.0 3136 16 ### OLD 0x0000000085900000-0x0000000085a00000 1048576 1048576 0 0.0 3136 16 ### OLD 0x0000000085a00000-0x0000000085b00000 1048576 1048576 0 0.0 3136 16 ### OLD 0x0000000085b00000-0x0000000085c00000 1048576 1048576 0 0.0 3136 16 ### OLD 0x0000000085c00000-0x0000000085d00000 1048576 1048576 0 0.0 3136 16 ### OLD 0x0000000085d00000-0x0000000085e00000 1048576 1048576 501136 0.0 11088 2016 ... ### OLD 0x000000008a000000-0x000000008a100000 524296 524296 2576 0.0 3136 16 ### FREE 0x000000008a100000-0x000000008a200000 0 0 0 0.0 3136 16 ### SURV 0x000000008a200000-0x000000008a300000 1048576 1048576 1048576 0.0 4168 16 ### SURV 0x000000008a300000-0x000000008a400000 1048576 1048576 1048576 0.0 3824 16 ### SURV 0x000000008a400000-0x000000008a500000 1048576 1048576 1048576 0.0 3824 16 ### SURV 0x000000008a500000-0x000000008a600000 1048576 1048576 1048576 0.0 3824 16 ### SURV 0x000000008a600000-0x000000008a700000 1048576 1048576 1048576 0.0 7368 16 ### SURV 0x000000008a700000-0x000000008a800000 1048576 1048576 1048576 0.0 9088 16 ### FREE 0x000000008a800000-0x000000008a900000 0 0 0 0.0 3136 16 ### FREE 0x000000008a900000-0x000000008aa00000 0 0 0 0.0 3136 16 ### EDEN 0x000000008c900000-0x000000008ca00000 1048576 1048576 1048576 0.0 3136 16 ### EDEN 0x000000008ca00000-0x000000008cb00000 1048576 1048576 1048576 0.0 3136 16 ### EDEN 0x000000008cb00000-0x000000008cc00000 1048576 1048576 1048576 0.0 3136 16 ### SUMMARY capacity: 124.00 MB used: 82.50 MB / 66.53 % prev-live: 82.50 MB / 66.53 % next-live: 44.85 MB / 36.17 % remset: 0.64 MB code-roots: 0.02 MB 2017-06-05T11:26:22.595+0800: 5.779: Application time: 0.0020252 seconds 2017-06-05T11:26:22.595+0800: 5.779: [GC concurrent-cleanup-start] 2017-06-05T11:26:22.595+0800: 5.779: [GC concurrent-cleanup-end, 0.0000586 secs] 5.899: [G1Ergonomics (Concurrent Cycles) do not request concurrent cycle initiation, reason: still doing mixed collections, occupancy: 65011712 bytes, allocation request: 0 bytes, threshold: 58510530 bytes (45.00 %), source: end of GC] // 開始mixed GC,由於有Concurrent Mark階段添加的old region候選 5.899: [G1Ergonomics (Mixed GCs) start mixed GCs, reason: candidate old regions available, candidate old regions: 29 regions, reclaimable: 15030208 bytes (11.56 %), threshold: 5.00 %] , 0.0136069 secs] [Parallel Time: 9.0 ms, GC Workers: 4] [GC Worker Start (ms): 5885.7 5885.7 5889.8 5889.8 Min: 5885.7, Avg: 5887.7, Max: 5889.8, Diff: 4.1] [Ext Root Scanning (ms): 0.3 0.3 0.0 0.0 Min: 0.0, Avg: 0.2, Max: 0.3, Diff: 0.3, Sum: 0.7] [Update RS (ms): 3.0 3.0 0.0 0.0 Min: 0.0, Avg: 1.5, Max: 3.0, Diff: 3.0, Sum: 6.0] [Processed Buffers: 9 7 0 0 ... // 收集夠足夠的內存後,取消 mixed GC回退到了 Young GC。 5.920: [G1Ergonomics (Mixed GCs) do not continue mixed GCs, reason: reclaimable percentage not over threshold, candidate old regions: 17 regions, reclaimable: 6121168 bytes (4.71 %), threshold: 5.00 %] , 0.0069783 secs] |