Hi Jon,<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">You're right that adjust_for_throughput() will not shrink the heap.<br>
Another part of the policy is that the heap is shrunk if the<br>
throughput goal and the pause time goal are being<br>
met. It's a slower process than just enforcing MaxHeapFreeRatio<br>
and requires a number of GC's (that is, the heap would be<br>
shrunk down a percentage at each GC). </blockquote><br><div>GC usually happens only as needed. So, after the application goes idle, GC does not probably happen. The next GC happens only after the application goes active again. Assuming that, there aren't many chances to shrink the heap (maybe only one). If the application calls System.gc() right before going idle, that may be the only chance. In such cases, the slower process may not work very well.<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">We would<br>
need to change the UseAdaptiveSizePolicy to do something like<br>
<br>
<br>
if ( average-pause > pause-goal)<br>
shrink heap<br>
else if (average-throughput < throughput-goal) &&<br>
! (UseFreeRatioForParallelGC && heap too empty)) <<<< new<br>
grow heap<br>
else<br>
shrink heap<br>
<br>
<br>
Or maybe something like<br>
<br>
<br>
if ( average-pause > pause-goal)<br>
shrink heap<br>
else if (average-throughput < throughput-goal)<br>
if (UseFreeRatioForParallelGC && heap too empty) <<<< new<br>
shrink heap (policy-to-be-determined) <<<<<br>
else <<<<<br>
grow heap<br>
else if (average-throughput < throughput-goal)<br>
grow heap to reduce gc overhead<br>
else<br>
shrink heap<br>
<br>
</blockquote></div><br>OK. I think the latter may be able to shrink the heap more aggressively.<br><br>Do you think the free ratio-based shrinking should happen only when the throughput goal is met? Using the above scenario, when the application is working hard (and perhaps GC is working hard as well) and goes idle next moment, the average throughput at the time of the phase change may not be good enough for the goal to be met (hence no shrinking).<br>
<br>Thanks,<br>Hiroshi<br><br>