RFR: 8280106: G1: Make reclaiming memory functionality more general in G1SegmentedArrayFreePool and G1SegmentedArrayFreeMemoryTask

Hamlin Li mli at openjdk.java.net
Thu Feb 10 06:04:07 UTC 2022


On Tue, 18 Jan 2022 04:31:47 GMT, Hamlin Li <mli at openjdk.org> wrote:

> We have planned to make memory reclaimation more general, and reuse it in evacuation failure processing after JDK-8254739.
> Some of the work has already been done in JDK-8276670 and JDK-8277542.
> But after JDK-8278917, there is no need to return the memory used by G1SegmentedArray in evacuation failure processing, as it uses another way to do it.
> Currently, G1SegmentedArrayFreePool and G1SegmentedArrayFreeMemoryTask is half-bound to card set, and half-general, it should be made more general for the readability of the code and future possible reuse of this functionality returning memory (used by G1SegmentedArray) to OS.

Currently, Configuration is only used to get the number of object types.
Do you suggest to use a const template parameter (e.g. template<MEMFLAGS flag, int NUM> class G1SegmentedArrayFreeMemoryTask) to replace the Configuration parameter? I don't object, but seems a Configuration parameter make it more clear to differentiate between 2 G1SegmentedArrayFreeMemoryTask even if they has the same number of object types.
Please kindly let me know you suggestion.

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

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



More information about the hotspot-gc-dev mailing list