<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta content="text/html; charset=utf-8">
</head>
<body>
<div id="compose-container" itemscope="" itemtype="https://schema.org/EmailMessage" style="direction:ltr">
<span itemprop="creator" itemscope="" itemtype="https://schema.org/Organization"><span itemprop="name"></span></span>
<div>
<div style="direction:ltr">I guess G1 started much later with Mixed Collections compared to CMS. And when no GC happens the cu is not 0. you should maybe log the collection count as well.</div>
<div><br>
</div>
<div style="direction:ltr">There is BTW A GC User mailinglist as well.</div>
<div><br>
</div>
<div class="acompli_signature">Gruss<br>
Bernd<br>
-- <br>
<a dir="ltr" href="http://bernd.eckenfels.net">http://bernd.eckenfels.net</a></div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> hotspot-gc-dev <hotspot-gc-dev-bounces@openjdk.java.net> on behalf of Sundara Mohan M <email.sundarms@gmail.com><br>
<b>Sent:</b> Wednesday, June 28, 2017 8:54:36 PM<br>
<b>To:</b> hotspot-gc-dev@openjdk.java.net<br>
<b>Subject:</b> Why is G1GC collection usage threshold not updated early?</font>
<div> </div>
</div>
<div>
<div dir="ltr">I am trying to estimate the free memory using metrics from MemoryPoolMxBean.getCollectionUsage().<br>
<br>
<div>I am observing following behavior with G1GC<br>
<br>
iteration=    0 - G1 Old Gen: u=  0% cu=  0% uth=75% cuth=75%<br>
iteration=  100 - G1 Old Gen: u=  0% cu=  0% uth=75% cuth=75%<br>
iteration=  200 - G1 Old Gen: u=  0% cu=  0% uth=75% cuth=75%<br>
iteration=  300 - G1 Old Gen: u=  0% cu=  0% uth=75% cuth=75%<br>
iteration=  400 - G1 Old Gen: u=  0% cu=  0% uth=75% cuth=75%<br>
iteration=  500 - G1 Old Gen: u=  1% cu=  0% uth=75% cuth=75%<br>
iteration=  600 - G1 Old Gen: u=  4% cu=  0% uth=75% cuth=75%<br>
iteration=  700 - G1 Old Gen: u=  9% cu=  0% uth=75% cuth=75%<br>
iteration=  800 - G1 Old Gen: u= 16% cu=  0% uth=75% cuth=75%<br>
iteration=  900 - G1 Old Gen: u= 25% cu=  0% uth=75% cuth=75%<br>
iteration= 1000 - G1 Old Gen: u= 34% cu=  0% uth=75% cuth=75%<br>
iteration= 1100 - G1 Old Gen: u= 45% cu=  0% uth=75% cuth=75%<br>
iteration= 1200 - G1 Old Gen: u= 38% cu=  0% uth=75% cuth=75%<br>
iteration= 1300 - G1 Old Gen: u= 46% cu=  0% uth=75% cuth=75%<br>
iteration= 1400 - G1 Old Gen: u= 52% cu=  0% uth=75% cuth=75%<br>
iteration= 1500 - G1 Old Gen: u= 45% cu=  0% uth=75% cuth=75%<br>
iteration= 1600 - G1 Old Gen: u= 67% cu=  0% uth=75% cuth=75%<br>
iteration= 1700 - G1 Old Gen: u= 56% cu=  0% uth=75% cuth=75%<br>
iteration= 1800 - G1 Old Gen: u= 55% cu=  0% uth=75% cuth=75%<br>
iteration= 1900 - G1 Old Gen: u= 61% cu=  0% uth=75% cuth=75%<br>
iteration= 2000 - G1 Old Gen: u= 56% cu=  0% uth=75% cuth=75%<br>
iteration= 2100 - G1 Old Gen: u= 76% cu=  0% uth=75% cuth=75%<br>
iteration= 2200 - G1 Old Gen: u= 65% cu=  0% uth=75% cuth=75%<br>
iteration= 2300 - G1 Old Gen: u= 62% cu=  0% uth=75% cuth=75%<br>
iteration= 2400 - G1 Old Gen: u= 75% cu=  0% uth=75% cuth=75%<br>
iteration= 2500 - G1 Old Gen: u= 75% cu=  0% uth=75% cuth=75%<br>
iteration= 2600 - G1 Old Gen: u= 72% cu=  0% uth=75% cuth=75%<br>
iteration= 2700 - G1 Old Gen: u= 69% cu=  0% uth=75% cuth=75%<br>
iteration= 2800 - G1 Old Gen: u= 74% cu=  0% uth=75% cuth=75%<br>
iteration= 2900 - G1 Old Gen: u= 80% cu=  0% uth=75% cuth=75%<br>
iteration= 3000 - G1 Old Gen: u= 83% cu=  0% uth=75% cuth=75%<br>
<b>iteration= 3100 - G1 Old Gen: u= 89% cu=  0% uth=75% cuth=75%<br>
iteration= 3200 - G1 Old Gen: u= 71% cu= 59% uth=75% cuth=75%</b><br>
iteration= 3300 - G1 Old Gen: u= 90% cu= 59% uth=75% cuth=75%<br>
iteration= 3400 - G1 Old Gen: u= 76% cu= 62% uth=75% cuth=75%<br>
iteration= 3500 - G1 Old Gen: u= 65% cu= 65% uth=75% cuth=75%
<div><br>
</div>
<div><br>
</div>
<div>CMS GC </div>
<div><br>
</div>
<div>
<div>iteration=    0 - CMS Old Gen: u=  0% cu=  0% uth=75% cuth=75%</div>
<div>iteration=  100 - CMS Old Gen: u=  0% cu=  0% uth=75% cuth=75%</div>
<div>iteration=  200 - CMS Old Gen: u=  1% cu=  0% uth=75% cuth=75%</div>
<div>iteration=  300 - CMS Old Gen: u=  3% cu=  0% uth=75% cuth=75%</div>
<div>iteration=  400 - CMS Old Gen: u= 12% cu=  0% uth=75% cuth=75%</div>
<div>iteration=  500 - CMS Old Gen: u= 19% cu=  0% uth=75% cuth=75%</div>
<div>iteration=  600 - CMS Old Gen: u= 34% cu=  0% uth=75% cuth=75%</div>
<div>iteration=  700 - CMS Old Gen: u= 43% cu=  0% uth=75% cuth=75%</div>
<div><b>iteration=  800 - CMS Old Gen: u= 63% cu=  0% uth=75% cuth=75%</b></div>
<div><b>iteration=  900 - CMS Old Gen: u= 48% cu= 37% uth=75% cuth=75%</b></div>
<div><b>iteration= 1000 - CMS Old Gen: u= 60% cu= 37% uth=75% cuth=75%</b></div>
<div>iteration= 1100 - CMS Old Gen: u= 58% cu= 45% uth=75% cuth=75%</div>
<div>iteration= 1200 - CMS Old Gen: u= 71% cu= 45% uth=75% cuth=75%</div>
<div>iteration= 1300 - CMS Old Gen: u= 66% cu= 53% uth=75% cuth=75%</div>
<div>iteration= 1400 - CMS Old Gen: u= 80% cu= 53% uth=75% cuth=75%</div>
</div>
</div>
<div><br>
</div>
<div>u = usage(getUsage), cu = collectionUsage (getCollectionUsage), uth = usage threshold %, cuth = collection usage threshold %</div>
<div>my program just keeps allocating string and frees some strings.</div>
<div><br>
</div>
<div>1. Why does G1GC doesn't update it's collection usage till 59% whereas in CMSGC it is updated at 37% itself?</div>
<div><br>
</div>
<div>Can someone shed more light on this?</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Sundar</div>
</div>
</div>
</body>
</html>