RFR: 8346920: Serial: Support allocation in old generation before GC [v2]

Kirk Pepperdine kirk at kodewerk.com
Mon Jan 20 19:16:49 UTC 2025


Hi,

One of the more important goals when tuning generational collectors and especially when tuning the the serial and parallel is to minimize the number of transients that end up in tenured. With that in mind I’m nervous about allocating in tenured to avoid a collection cycle. First, the probability that these (prematurely promoted) allocations are transit is likely > 90%. More over, transients in tenured tend to create zombies. Zombies put further pressure on tenure. Each of these “conditions” will increase the frequency of full collections and fulls are way more costly than young collections.

IME, techniques that have been tried in the past to avoid collections end up being more expensive than simply triggering the collection when it is needed. Worst case, I’d allocate in the active survivor space as that should be about 50% empty by default. At least that space will be collected by the next young gen thus avoiding the problems that come with having transients in tenured.

Kind regards,
Kirk Pepperdine


> On Jan 7, 2025, at 8:08 AM, Guoxiong Li <gli at openjdk.org> wrote:
> 
> On Mon, 6 Jan 2025 14:36:23 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
> 
>>> This PR introduces a new strategy to determine whether an allocation should be attempted in the old generation or if a GC cycle should be initiated, based on the `GCTimeRatio`. With this change, the benchmark attached to the ticket now completes in ~13 GC, a significant improvement compared to the >1000 GC observed previously.
>>> 
>>> Test: tier1-3
>> 
>> Albert Mingkun Yang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>> 
>> - review
>> - Merge branch 'master' into s1-gc-time-ratio
>> - s1-gc-time-ratio
> 
> Looks good.
> 
> -------------
> 
> Marked as reviewed by gli (Reviewer).
> 
> PR Review: https://git.openjdk.org/jdk/pull/22899#pullrequestreview-2533524913



More information about the hotspot-gc-dev mailing list