[PATCH] JDK-23: Fix for relocation set selecting in ZGC
yifan zhang
yifanzhang765 at gmail.com
Thu Oct 9 09:16:49 UTC 2025
Hi ZGC Developers,
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
diff_reclaimable > _fragmentation_limit, while ignoring the previously
accumulated pages.
This results in a mismatch between the number of pages actually
reclaimed during relocation and the count reflected in the log.
I have attached my modifications in the attachment.
* Testing:
I've tested this fix by jtreg.
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,
Yifan Zhang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/zgc-dev/attachments/20251009/8b58277f/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zgc_fix.patch
Type: application/octet-stream
Size: 4021 bytes
Desc: not available
URL: <https://mail.openjdk.org/pipermail/zgc-dev/attachments/20251009/8b58277f/zgc_fix.patch>
More information about the zgc-dev
mailing list