RFR: 8254739: G1: Optimize evacuation failure for regions with few failed objects [v19]

Hamlin Li mli at openjdk.java.net
Fri Nov 5 11:06:19 UTC 2021


On Fri, 5 Nov 2021 10:54:54 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> drop_all just returns buffers to free list, it will not destruct the buffers. So, iterate multiple times is OK, because next time it will get memory from free list or allocate a new buffer. Hope this answer your question.
>
> Since `drop_all()` resets all counters (e.g. `_num_allocated_nodes`), the subsequent iteration will think the array is empty, won't it?

For example, we modify the code as below:

> void HeapRegion::iterate_evac_failure_objs(ObjectClosure* closure) {
>   _evac_failure_objs.iterate(closure);
>   _evac_failure_objs.iterate(closure);
> }

For the second time iteration, all thing will be empty, so iterate_nodes will be an empty operation, QuickSort::sort too,  and iterate_internal too. These empty operations will not do harm things.

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

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



More information about the hotspot-gc-dev mailing list