-
Notifications
You must be signed in to change notification settings - Fork 981
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
Total promotion can get negative #235
Comments
As far as I understand the situation the fix won't be that simple.
This is the first GC line that would give a negative promotion of -8192.
Can someone with G1 experience enlighten me? Edit 1: |
@cmoetzing Thank you for your input! I also hope someone can enlighten me how to fix this properly 😉 I also rechecked my fix with the provided logfile against gceasy.io. The results are the following: I also created this artificial log file with the GC event from your comment to check what they calculate for events I fixed with the linked PR: So it seems my fix works only in some cases. Otherwise the full log file would display the same promotion. |
I understand why the current calculations overestimate in some cases.
I would fix this issue by counting only |
I tried to implement a fix in #242 . At the moment I am thinking about whether |
I would say for G1 the humongous allocations are important. So if we don't count it to the promotion (which might be a good idea since it can be rather missleading) then we should offer it as a separate measurement (at least as far as possible). |
According to this Oracle article https://www.oracle.com/technical-resources/articles/java/g1gc.html the humongous allocation happens directly in the old generation.
So this is clearly no promotion from a young generation to an old generation. |
Wouldn't it be best to divide young and tenured into eden, survivor, old and humongous then? No reason to hide any info. |
I'm generally agreeing with you but this would make sense for G1GC and not for the other supported garbage collectors. Not sure such a specialized solution for 1 garbage collector will be accepted by the maintainer. |
GCViewer reports a negative total promotion for this Java 11 G1GC log:
gc.log.gz
I made a quick check and it seems that the
updatePromotion
inGCModel
calculates for some GC Events negative promotion values and adds them to the total promotion.Maybe a simple
>= 0
check will fix the problem if the calculation is correct.The text was updated successfully, but these errors were encountered: