((heap * cms fraction) – current heap used (young and tenured)) / growth rate = prediction
Sample data from GC log…
: 4499906K->310178K(4718592K), 0.2461130 secs] 10382742K->6214227K(12058624K), 0.2469460 secs] [Times: user=2.77 sys=0.03, real=0.25 secs] 2016-10-25T09:41:02.431-0400: 48708.056: [GC 48708.056: [ParNew48708.198: [SoftReference, 0 refs, 0.0020420 secs]48708.200: [WeakReference, 270805 refs, 0.0164270 secs]48708.216: [FinalReference, 64232 refs, 0.0398110 secs]48708.256: [PhantomReference, 4 refs, 0.0014000 secs]48708.258: [JNI Weak Reference, 0.0152670 secs] : 4504482K->337875K(4718592K), 0.2190810 secs] 10408531K->6262051K(12058624K), 0.2199090 secs] [Times: user=2.43 sys=0.04, real=0.22 secs] 2016-10-25T09:41:27.014-0400: 48732.639: [GC 48732.639: [ParNew48732.802: [SoftReference, 0 refs, 0.0025140 secs]48732.805: [WeakReference, 51342 refs, 0.0058420 secs]48732.810: [FinalReference, 65488 refs, 0.0444180 secs]48732.855: [PhantomReference, 4 refs, 0.0014280 secs]48732.856: [JNI Weak Reference, 0.0178460 secs] : 4532179K->321998K(4718592K), 0.2363660 secs] 10456355K->6278650K(12058624K), 0.2371750 secs] [Times: user=2.67 sys=0.04, real=0.24 secs] 2016-10-25T09:41:52.724-0400: 48758.349: [GC 48758.349: [ParNew48758.467: [SoftReference, 0 refs, 0.0025300 secs]48758.469: [WeakReference, 50217 refs, 0.0048760 secs]48758.474: [FinalReference, 62385 refs, 0.0401380 secs]48758.515: [PhantomReference, 0 refs, 0.0017490 secs]48758.516: [JNI Weak Reference, 0.0189490 secs] : 4516302K->268024K(4718592K), 0.1880510 secs] 10472954K->6249999K(12058624K), 0.1888660 secs] [Times: user=2.04 sys=0.03, real=0.19 secs] 2016-10-25T09:42:17.839-0400: 48783.464: [GC 48783.465: [ParNew48783.572: [SoftReference, 0 refs, 0.0022150 secs]48783.574: [WeakReference, 52409 refs, 0.0041950 secs]48783.578: [FinalReference, 63089 refs, 0.0407380 secs]48783.619: [PhantomReference, 2 refs, 0.0025640 secs]48783.622: [JNI Weak Reference, 0.0146210 secs]
12058624 – 10382742 = 1675882
12058624 – 10408531 = 1650093, 25789 growth in 25 seconds
12058624 – 10456355 = 1602269, 47824 growth in 25 seconds
12058624 – 10472954 = 1585670, 16599 growth in 25 seconds
So about 1000K per second, roughly on average.
We have 12058624 * 0.92 (default CMS fraction) = 11093934
11093934 – 10472954 = 620980K / 1000K = 620 seconds, or roughly ten minutes until full CMS occurs.