<div dir="ltr">Since hotspot-gc-dev does not support pictures/screenshots, here is the context based on a previous email that Shaojun sent to me directly.<div><br></div><div>First screenshot is from <a href="https://github.com/openjdk/jdk/pull/24211#issuecomment-2777769994">https://github.com/openjdk/jdk/pull/24211#issuecomment-2777769994</a>:</div><div><br></div>> Somewhat related to above, our experience with our internal algorithm that adjusts SoftMaxHeapSize based on GC CPU overhead, encountered cases that it behaves poorly. The problem is that some workload have large variance in mutator's CPU usage (e.g. peak hours vs off-peak hours), but smaller variance in GC CPU usage. Then it does not make much sense to maintain a constant % for GC CPU overhead, which could cause excessive heap expansion when mutator CPU usage is low. The workaround is to take live size into consideration when calculating SoftMaxHeapSize, which is similar to how Min/MaxHeapFreeRatio works.<br>> I'm not sure if GCTimeRatio using wall time and pause time could run into similar issues. I'm happy to experiment when we make progress on JDK-8238687/JDK-8248324/JDK-8349978.<div><div><br></div><div>Second screenshot is from <a href="https://bugs.openjdk.org/browse/JDK-8359348?focusedId=14802633#comment-14802633">https://bugs.openjdk.org/browse/JDK-8359348?focusedId=14802633#comment-14802633</a>:</div><br>> Regarding to the fluctuating mutator CPU usage issue, upon reviewing <a href="https://github.com/openjdk/jdk/pull/26351">https://github.com/openjdk/jdk/pull/26351</a>, I'm convinced that the proposed approach does not suffer from this issue. This is because the proposed approach does not rely on the total process CPU usage, and does not measure "GC CPU overhead", i.e., a ratio of GC CPU usage over total CPU usage.<div><br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">-Man</div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 23, 2026 at 11:28 PM shaojun wang <<a href="mailto:jeffery.wsj@outlook.com" target="_blank">jeffery.wsj@outlook.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>




<div dir="ltr">
<div style="text-align:left;text-indent:0px;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Hi Men Cao</div>
<div style="text-align:left;text-indent:0px;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="text-align:left;text-indent:0px;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
I read one openjdk bug which discuss  G1 heap adaptive resizing feature, and I noticed that you mention one question like this:</div>
<div style="text-align:left;text-indent:0px;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="text-align:left;text-indent:0px;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<img style="width: 562px; height: 129px; max-width: 894px;" height="129" width="562" alt="image.png" src="https://mail.google.com/mail/u/0?ui=2&ik=6608b5cc4f&attid=0.1&permmsgid=msg-a:r-6477420736395640503&th=19be4ccde98acac8&view=fimg&fur=ip&permmsgid=msg-a:r-6477420736395640503&sz=s0-l75-ft&attbid=ANGjdJ_jNEj_KMV3_ZHCEk7i8wTwfOTFvj06M7VqBYNmzqEwmd_Z1oMt_lcbJpwfMS50dCifqsTnp5EfRYY_yMWSUiCSPZEahk2zjp4vdd29oMO8-hihmpCHPpLZUaU&disp=emb&realattid=ii_mkp6cic00&zw"></div>
<div style="text-align:left;text-indent:0px;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="text-align:left;text-indent:0px;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
and then you mentioned that you were convinced that the proposed approach does not suffer from this issue. This is because the proposed approach </div>
<div style="text-align:left;text-indent:0px;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
does not rely on the total process CPU usage, and does not measure "GC CPU overhead", i.e., a ratio of GC CPU usage over total CPU usage.</div>
<div style="text-align:left;text-indent:0px;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="text-align:left;text-indent:0px;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<img style="width: 562px; height: 118px; max-width: 894px;" height="118" width="562" alt="image.png" src="https://mail.google.com/mail/u/0?ui=2&ik=6608b5cc4f&attid=0.2&permmsgid=msg-a:r-6477420736395640503&th=19be4ccde98acac8&view=fimg&fur=ip&permmsgid=msg-a:r-6477420736395640503&sz=s0-l75-ft&attbid=ANGjdJ8NJyMS1MMi8hjRsdSxUK8Rmbb7u1HQXijYiUvgzwPu5dglo-zREL_Q0m0XhpmSUPB9EIb4k-4655fXVoGRNuZnI080bazEd71s7zbQtrKEclHkNn6T7AnkP4U&disp=emb&realattid=ii_mkp6gwev1&zw"></div>
<div style="text-align:left;text-indent:0px;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="text-align:left;text-indent:0px;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
my question is that even with GCTimeRatio(gc time / (gc time + app time)) , the problem will still exist if the application</div>
<div style="text-align:left;text-indent:0px;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
fall into a very low cpu cost state. for example, gc_time = 30, app_time=40,GCTimeRatio is: 30/(30+40)= 0.42, the g1</div>
<div style="text-align:left;text-indent:0px;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
heap size policy will try to extend heap size to scale down GCTimeRatio。But actually the application doesn't care about</div>
<div style="text-align:left;text-indent:0px;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
its performance at all under the state,because there is basically no or merely request for the app. Do you have idea about</div>
<div style="text-align:left;text-indent:0px;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
it?</div>
<div style="text-align:left;text-indent:0px;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="text-align:left;text-indent:0px;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(17,85,204)">
<a style="color:rgb(17,85,204)" id="m_5710840970226757080m_-8525208379942971413OWA5e02980e-74c4-030d-827e-39ff2aa66859" href="https://github.com/openjdk/jdk/pull/24211" target="_blank">https://github.com/openjdk/jdk/pull/24211</a></div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(17,85,204)">
<a style="color:rgb(17,85,204);text-align:left" id="m_5710840970226757080m_-8525208379942971413OWAba641e2d-0b09-d31b-d044-f63693f824f0" href="https://bugs.openjdk.org/browse/JDK-8359348" target="_blank">https://bugs.openjdk.org/browse/JDK-8359348</a></div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
>From shaojun wang</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
ByteDance</div>
</div>

</div></blockquote></div>