RFR: 8258431: Provide a JFR event with live set size estimate [v12]

Jaroslav Bachorik jbachorik at openjdk.java.net
Mon Mar 15 09:25:12 UTC 2021


On Mon, 15 Mar 2021 09:18:52 GMT, Jaroslav Bachorik <jbachorik at openjdk.org> wrote:

>> src/hotspot/share/gc/shared/space.inline.hpp line 140:
>> 
>>> 138:   size_t get_dead_space() {
>>> 139:     return (_max_deadspace_words - _allowed_deadspace_words) * HeapWordSize;
>>> 140:   }
>> 
>> Hotspot does not use a "get_" prefix for getters. Also not sure why this needs to be private (and the friend class), I would prefer this instead of the friending. Retrieving the actual amount of dead space from a class that calculates it does not  seem something that needs hiding.
>
> The visibility for `_dead_space` was changed based on this comment: https://github.com/openjdk/jdk/pull/2579/files/f69541864e093bc5b250bf625ec75983764ba2bf#r585771280 by @shipilev

Also, I see a bunch of methods named `get_*` in GC code alone. I have no problem renaming it to eg. `dead_space()` but it does not seem that this naming pattern is not used in hotspot.

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

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



More information about the hotspot-gc-dev mailing list