RFR: JDK-8274249: ZGC: Bulk free empty relocated pages [v2]

王超 github.com+25214855+casparcwang at openjdk.java.net
Wed Sep 29 08:56:31 UTC 2021


On Wed, 29 Sep 2021 08:06:23 GMT, 王超 <github.com+25214855+casparcwang at openjdk.org> wrote:

> * Instead of checking for the allocator type in the general code, this whole thing could be moved into the ZRelocateSmallAllocator, like this: [master...pliden:8274249_zgc_bulk_free_empty_pages](https://github.com/openjdk/jdk/compare/master...pliden:8274249_zgc_bulk_free_empty_pages)

Move into `ZRelocateSmallAllocator` make code cleaner and easier to understand. It's a more elegant. So I changed to your provided version, and use `ZPerWorker ` to avoid the contention between the gc workers.

>  However, in the case were memory is low, GC workers are now hogging free memory could cause allocation stalls to be longer than needed and cause in-place relocation to happen more often than needed. 

If in-place relocation has happened, the pages are always freed directly.

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

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



More information about the hotspot-gc-dev mailing list