RFR: 7169803: Usage of pretenured value is not correct

Tao Mao yiyeguhu at gmail.com
Thu Jun 11 00:51:35 UTC 2015


I think David's right. Promoted objects and pretenured objects are
different guys. This would resolve the second issue in the ticket
JDK-7169803.

Thanks.
Tao Mao

On Wed, Jun 10, 2015 at 5:08 PM, Jon Masamitsu <jon.masamitsu at oracle.com>
wrote:

>
>
> On 6/10/2015 1:30 AM, David Lindholm wrote:
>
>> Jon,
>>
>> Thanks for taking a look at this. No, I don't think this will lead to
>> double counting. This calculation is already there, it is just buggy.
>> Before this patch the code added the total amount of promoted memory this
>> collection with the average size of the pretenured objects, and used this
>> as a sample. Now the code adds the total amount of promoted memory with the
>> total size of the pretenured objects since last collection, and uses this
>> as a sample instead.
>>
>
> Aren't "promoted" and "total_pretenured_since_last_promotion()"
> approximately the same
> thing?  In share/vm/gc/parallel/psScavenge.cpp
>
> 489       size_t promoted = old_gen->used_in_bytes() - old_gen_used_before;
> 490       size_policy->update_averages(_survivor_overflow, survived,
> promoted);
>
> so "promoted" is the change in the old gen between the before and after the
> young gen collection.
>
> "total_pretenured_size_last_promotion()" is
>
>  258   void tenured_allocation(size_t size) {
>  259     _avg_pretenured->sample(size);
>  260     add_pretenured_since_last_promotion(size)
>
>
> which seems to me to be calculating the same thing (sum of allocations
> into the old gen).
>
> Not so?
>
> Jon
>
>
>
>>
>> Thanks,
>> David
>>
>> On 2015-06-09 21:37, Jon Masamitsu wrote:
>>
>>> David,
>>>
>>>
>>> http://cr.openjdk.java.net/~david/JDK-7169803/webrev.00/src/share/vm/gc/parallel/psAdaptiveSizePolicy.cpp.frames.html
>>>
>>> 1308   avg_promoted()->sample(promoted +
>>> total_pretenured_since_last_promotion());
>>>
>>>
>>> Is including both "promoted" and
>>> "total_pretenured_since_last_promotion()"
>>> double counting?
>>>
>>> Jon
>>>
>>> On 06/09/2015 02:06 AM, David Lindholm wrote:
>>>
>>>> Hi,
>>>>
>>>> Please review this patch that corrects the usage of the pretenured
>>>> value. There were 2 issues: words and bytes were mixed up and the addition
>>>> was done with the wrong value. See bug for details.
>>>>
>>>> Webrev: http://cr.openjdk.java.net/~david/JDK-7169803/webrev.00/
>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-7169803
>>>>
>>>>
>>>> Testing: Passed JPRT
>>>>
>>>>
>>>> Thanks,
>>>> David
>>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-gc-dev/attachments/20150610/432560d2/attachment.htm>


More information about the hotspot-gc-dev mailing list