<div dir="ltr"><div class="gmail-mail-detail-subject" style="color:rgb(0,0,0);font-size:14px;font-family:-apple-system,BlinkMacSystemFont,system-ui,"PingFang SC","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans CN","Noto Sans CJK SC",sans-serif"><span style="font-family:monospace;white-space:pre">Hi ZGC Developers,</span></div><div class="gmail-mail-detail-content" style="font-size:14px;color:rgb(19,24,29);line-height:1.43;word-break:normal;min-height:100px;padding:20px 0px;box-sizing:border-box;overflow:auto hidden;font-family:-apple-system,BlinkMacSystemFont,system-ui,"PingFang SC","Microsoft YaHei UI","Microsoft YaHei","Source Han Sans CN","Noto Sans CJK SC",sans-serif"><div class="gmail-qmbox" style="min-height:526px"><pre style="margin:0px;line-height:1.43"><p style="margin:0px;line-height:1.43"><span style="color:rgb(0,0,0)">I've encountered an issue where ZGC might fail to promote objects under a specific condition, leading to a memory leak. This patch aims to fix it.

* Problem:
  The number of selected pages in the ZGC log is incorrect.

* Fix:
  The root cause lies in the execution of function ZRelocationSetSelectorGroup::select_inner, where the count of selected pages only includes the pages that satisfy the condition <code>diff_reclaimable > _fragmentation_limit</code>, while ignoring the previously accumulated pages. </span></p><p style="margin:0px;line-height:1.43"><span style="color:rgb(0,0,0)">  This results in a mismatch between the number of pages actually reclaimed during relocation and the count reflected in the log.</span></p><p style="margin:0px;line-height:1.43"><span style="color:rgb(0,0,0)">  I have attached my modifications in the attachment.

* Testing:
  I've tested this fix by jtreg.</span></p><p style="margin:0px;line-height:1.43"><span style="color:rgb(0,0,0)">
</span></p><p style="margin:0px;line-height:1.43"><span style="color:rgb(0,0,0)">I would like to ask ZGC developers to review whether this can be created as an issue. Once it is created, how should I commit my modifications for it? Furthermore, how can I become an OpenJDK author?
Please help to review this patch. Any feedback is appreciated.

Thanks,
</span></p><div style="line-height:1.43;color:rgb(0,0,0)">Yifan Zhang</div></pre></div></div></div>