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

Albert Mingkun Yang ayang at openjdk.java.net
Fri Nov 5 11:21:13 UTC 2021


On Fri, 5 Nov 2021 11:12:06 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> 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.
>
> @Hamlin-Li : I think @albertnetymk concern is that typically an `iterate` method does not modify the list itself. That is surprising for readers. The documentation also does not indicate any of that. I do not think he believes this will cause a VM failure.
> 
> Maybe change `HeapRegion::iterate_evac_failure_objs` to call a (new) `drop()` method on `_evac_failure_objs`?
> 
> I think such a change would solve Albert's concerns.
> 
> An alternative could be renaming `iterate` to something else.

Thank Thomas for unpacking my concern more precisely. I used "problematic" to mean the second iteration will not do what developers expect it to do, not necessarily a VM crash.

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

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


More information about the hotspot-gc-dev mailing list