Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GC Phase Times getter for the Parallel GC #377

Open
AlinaHovakimyan opened this issue Sep 2, 2024 · 1 comment
Open

GC Phase Times getter for the Parallel GC #377

AlinaHovakimyan opened this issue Sep 2, 2024 · 1 comment

Comments

@AlinaHovakimyan
Copy link
Contributor

Parsing seems to be done but getter is missing from GenerationalForwardReference.

@dsgrieve
Copy link
Member

dsgrieve commented Sep 4, 2024

The forward references are sort of like builder patterns and are turned into events. For example, here's some code from G1CGForwardReference:

private G1Young buildYoung(G1Young collection) {
    fillInMemoryPoolStats(collection);
    fillInRegionSummary(collection);
    fillInMetaspaceStats(collection);
    fillInPhases(collection);
    if (toSpaceExhausted) collection.toSpaceExhausted();
    if (hasReferenceGCSummary())
        collection.add(generateReferenceGCSummary());
    collection.addCPUSummary(getCPUSummary());
    return collection;
}

There are similar methods for other event types.

The reason we've done this is that events are immutable. To create the immutable event, we collect the data before building the event. This is the purpose of the forward reference. Once the end of the event is parsed, we build the event. This is why there are no getters on the forward references.

If one wants to include more data in the event, no problem. One just need to make sure the data is collected and pushed to the forward reference and then added to the event. Note that events are part of the public API so adding new API is okay but existing methods should not be modified.

This comment applies to the other issues filed regarding missing getters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants