RFR: 8346920: Serial: Support allocation in old generation before GC
Guoxiong Li
gli at openjdk.org
Mon Jan 6 14:17:37 UTC 2025
On Thu, 2 Jan 2025 06:30:00 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
Nice improvement.
src/hotspot/share/gc/serial/defNewGeneration.hpp line 53:
> 51: class DefNewGeneration: public Generation {
> 52: friend class VMStructs;
> 53: friend class SerialHeap;
Not really know whether it is a good way. Maybe we can export a method `DefNewGeneration::gc_timer`.
src/hotspot/share/gc/serial/serialHeap.cpp line 334:
> 332:
> 333: bool first_only = !should_try_older_generation_allocation(size)
> 334: && is_long_enough_from_prev_gc_pause_end();
Is the `first_only` actually `young_only`? It means that the allocation is only attempted in young generation?
src/hotspot/share/gc/serial/serialHeap.cpp line 643:
> 641: Ticks prev_gc_pause_end;
> 642: Tickspan gc_pause;
> 643: if (full_gc_pause_end < young_gc_pause_end ) {
A unnecessary space after `young_gc_pause_end`.
-------------
Changes requested by gli (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/22899#pullrequestreview-2532209941
PR Review Comment: https://git.openjdk.org/jdk/pull/22899#discussion_r1904201771
PR Review Comment: https://git.openjdk.org/jdk/pull/22899#discussion_r1904191931
PR Review Comment: https://git.openjdk.org/jdk/pull/22899#discussion_r1904196305
More information about the hotspot-gc-dev
mailing list