RFR: 8297247: Remark time not added to G1 GarbageCollectorMXBeans [v2]
Thomas Schatzl
tschatzl at openjdk.org
Fri Nov 25 11:18:36 UTC 2022
On Thu, 24 Nov 2022 08:14:28 GMT, Yude Lin <duke at openjdk.org> wrote:
>> Hi,
>>
>> This change uses a G1MonitorScope (covers jstat and GC beans) to replace TraceCollectorStats (only covers jstat) in VM_G1PauseConcurrent::doit(), so that now Remark and Cleanup phase time are both collected by a GC bean.
>> This change adds a third bean "G1 Concurrent GC", after "G1 Young Generation" and "G1 Old generation". This has good continuity, meaning that any current application code who uses "G1 Young Generation" and "G1 Old generation" will see nothing changed, but it will now observe a third bean and can decide what to do with it, e.g., summing all of them up.
>> Also now the gc beans and jstat fields have 1-to-1 correspondance:
>> "G1 Young Generation" -- YGC/YGCT
>> "G1 Old generation" -- FGC/FGCT
>> "G1 Concurrent GC" -- CGC/CGCT
>>
>> Alternative:
>> I've considered using the existing bean "G1 Old generation", but it's currently used for Full GCs, and I find unifying Full GCs with Remark and Cleanup under the same bean is a little awkward. For example, I couldn't find a proper name for the G1MemoryManager, or a proper "gc end message" for the post-gc notification. Also, in this way, if users have previously hooked "G1 Old generation" to some kind of Full GC alarm, then they might suddenly find a lot of false-positives (caused by Remark and Cleanup). So this is undesirable.
>
> Yude Lin has updated the pull request incrementally with one additional commit since the last revision:
>
> Test fixes
Lgtm, apart from some naming consistency issues.
I'll run the change through our testing too, taking a bit.
src/hotspot/share/gc/g1/g1MonitoringSupport.cpp line 352:
> 350:
> 351: G1MonitoringScope::G1MonitoringScope(G1MonitoringSupport* monitoring_support)
> 352: : _monitoring_support(monitoring_support) { }
Suggestion:
G1MonitoringScope::G1MonitoringScope(G1MonitoringSupport* monitoring_support) :
_monitoring_support(monitoring_support) { }
src/hotspot/share/gc/g1/g1MonitoringSupport.hpp line 247:
> 245: };
> 246:
> 247: class G1IncMonitoringScope : public G1MonitoringScope {
Suggestion:
class G1YoungGCMonitoringScope : public G1MonitoringScope {
Everything about young collection is prefixed with "YoungGC", let's keep naming consistent.
src/hotspot/share/gc/g1/g1MonitoringSupport.hpp line 255:
> 253: };
> 254:
> 255: class G1FullMonitoringScope : public G1MonitoringScope {
Suggestion:
class G1FullGCMonitoringScope : public G1MonitoringScope {
Similiarly, the prefix should be "FullGC" for consistency.
src/hotspot/share/gc/g1/g1MonitoringSupport.hpp line 263:
> 261: };
> 262:
> 263: class G1ConcMonitoringScope : public G1MonitoringScope {
Suggestion:
class G1ConcGCMonitoringScope : public G1MonitoringScope {
The member is called `_conc_gc_...` and the name of the bean also "Concurrent GC...".
-------------
Changes requested by tschatzl (Reviewer).
PR: https://git.openjdk.org/jdk/pull/11341
More information about the hotspot-gc-dev
mailing list