RFR: 8280087: G1: Handle out-of-mark stack situations during reference processing more gracefully [v5]

Albert Mingkun Yang ayang at openjdk.org
Mon Dec 11 15:53:16 UTC 2023


On Fri, 8 Dec 2023 13:37:28 GMT, Ivan Walulya <iwalulya at openjdk.org> wrote:

> ...  is the general approach to growing "vectors" / "arrays"

That's true, but in this case, there is a 'ceiling' value. The overall goal mark-stack-resizing is to strike a balance between two conflicting constraints: minimizing the number of expands and minimizing the average mark-stack footprint. The approach I have in mind is to 'hardcode' the #expands to a constant, let's say 4. This way, each expand accounts for (max - init) / 4. (Using 2 seems too small, and the next even number is 4.)

For example, when init = 4 and max = 8 (in whatever suitable unit), the mark-stack capacity can grow like this:

double-on-expand: 4 -> 8
equal-delta ((8-4)/4 == 1): 4 -> 5 -> 6 -> 7 -> 8

In the double-on-expand case, there is only a single expand, effectively losing the elasticity of a growable mark-stack. Also, I think equal-delta will have a simpler implementation.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16979#discussion_r1422700430


More information about the hotspot-gc-dev mailing list