-
Notifications
You must be signed in to change notification settings - Fork 156
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
Move g1 heapRegionSize from class variable to member variable #324
Conversation
@loyispa Interesting, I'd love to learn more about how/why you're running multiple instances of GCToolkit if you're able to share? |
@karianna, I am developing a tool that can analyze multiple streaming logs using this great library. I am currently facing a problem if multiple logs of G1 with different region sizes were analyzed concurrently, there would be incorrect calculations for Eden and Survival occupancy because of the sharing of heapRegionSize. |
IMHO, I don't think it's correct to include region size with each G1 event. However, there isn't an alternative context to put this static/never changing for a single GC log. IOWs, we didn't give too much thought to parsing multiple logs at the same time. I was thinking that maybe adding a session object might help but then I was thinking that there are other problems you'd run into for this use case. I'm inclined to merge this with the caveat that it might be deprecated in favour of a better solution. @dsgrieve would you care to offer an opinion here? |
parser/src/main/java/com/microsoft/gctoolkit/parser/G1GCForwardReference.java
Show resolved
Hide resolved
parser/src/main/java/com/microsoft/gctoolkit/parser/G1GCForwardReference.java
Outdated
Show resolved
Hide resolved
parser/src/main/java/com/microsoft/gctoolkit/parser/UnifiedG1GCParser.java
Outdated
Show resolved
Hide resolved
@kcpeppe I'm inclined to accept the change with some minor modifications. This will allow @loyispa to move forward but doesn't prevent a possible alternative in the future. |
Concurrent GCToolKit instances with different g1 region-size will affect each other because of their static sharing of G1GCForwardReference#heapRegionSize. Consider moving it to a member variable.