RFR: 8256390: ZGC: Relocate in-place instead of having a heap reserve [v2]

Per Liden pliden at openjdk.java.net
Fri Nov 20 13:04:09 UTC 2020


On Fri, 20 Nov 2020 12:13:16 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

>> Per Liden has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Review Stefank
>
> src/hotspot/share/gc/z/zStat.cpp line 1281:
> 
>> 1279: 
>> 1280: size_t ZStatHeap::allocated(size_t used, size_t reclaimed) {
>> 1281:   return (used + reclaimed) - _at_mark_start.used;
> 
> I don't know why used + reclaimed is the amount allocated. Is this correct? Could you add a comment?

We do "used_now - used_at_some_earlier_point" to see how much the used grew (i.e. now much was allocated). However, if we just do that, we will fail to take into account that we might also have reclaimed memory, which would have lowered "used_now". So, we let "used_now" be "used + reclaimed" to get the used we would have seen if we had not reclaimed any memory. Hope that makes sense. I'll add a comment.

-------------

PR: https://git.openjdk.java.net/jdk/pull/1228



More information about the hotspot-gc-dev mailing list