<p dir="ltr">Hi John,</p>
<p dir="ltr">In G1CollectorPolicy::calc_min_old_cset_length(), is it possible to get 0 for G1MixedGCCountTarget? If so, will get div by zero there.</p>
<p dir="ltr">Thanks<br></p>
<p dir="ltr">Sent from my phone</p>
<div class="gmail_quote">On Jan 28, 2013 5:01 PM, "John Cuthbertson" <<a href="mailto:john.cuthbertson@oracle.com">john.cuthbertson@oracle.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Everyone,<br>
<br>
Can I have a couple of volunteers look over the changes for this CR? The webrev is at: <a href="http://cr.openjdk.java.net/~johnc/8007036/webrev.0/" target="_blank">http://cr.openjdk.java.net/~<u></u>johnc/8007036/webrev.0/</a><br>

<br>
Summary:<br>
When adding old regions to the collection set we don't take into account whether the old regions added so far take us below the G1HeapWastePercent. As a result we could end up adding (and collecting) many more regions than we needed to. The actual number added was the minimum between the number of candidate regions / G1MixedGCCountTarget and 10% of the heap.<br>

<br>
Currently the calculation of the reclaimable bytes as a percentage of the uses exact arithmetic. It might make sense, at some point in the future, to use inexact arithmetic (rounding) in the decision on whether to continue mixed GCs and use exact arithmetic when adding regions.<br>

<br>
As part of this change I've also moved a couple routines from CollectionSetChooser to G1CollectorPolicy. I think they "fit" better in G1CollectorPolicy.<br>
<br>
Testing:<br>
GCOld with tenuring threshold = 1 and a marking threshold = 10.<br>
<br>
Many thanks to Monica for identifying the issue.<br>
<br>
Thanks,<br>
<br>
JohnC<br>
</blockquote></div>