RFR: 8348171: Refactor GenerationCounters and its subclasses [v2]

Guoxiong Li gli at openjdk.org
Thu Jan 30 15:23:52 UTC 2025


On Thu, 30 Jan 2025 14:48:39 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

> We can probably uniform them, but the benefit seems small, IMO.

OK, I also think so.

>> src/hotspot/share/gc/shared/generationCounters.cpp line 72:
>> 
>>> 70: void GenerationCounters::update_all(size_t curr_capacity) {
>>> 71:   _current_size->set_value(curr_capacity);
>>> 72: }
>> 
>> I don't think the `update_all` is a good method name because it only modifies the current capacity(committed size). But this method had been used since OpenJDK opened source, so we don't know its commit history before opening source. Maybe the method name `update_capacity` in the class `ZGenerationCounters` is a better name we can adopt here.
>
> I agree the current name can be improved to sth like `update_capacity`, but it also seems that such renaming can/should be done in its own PR, so I kept it as is.

Filed https://bugs.openjdk.org/browse/JDK-8349077 to follow up.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23209#discussion_r1935801820
PR Review Comment: https://git.openjdk.org/jdk/pull/23209#discussion_r1935800322


More information about the hotspot-gc-dev mailing list