-
Notifications
You must be signed in to change notification settings - Fork 978
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
Fix for negative promotion calculation #237
base: develop
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #237 +/- ##
=============================================
+ Coverage 70.43% 70.46% +0.02%
- Complexity 1518 1519 +1
=============================================
Files 145 145
Lines 8596 8597 +1
Branches 1389 1390 +1
=============================================
+ Hits 6055 6058 +3
+ Misses 1961 1958 -3
- Partials 580 581 +1
Continue to review full report at Codecov.
|
- (event.getPreUsed() - event.getPostUsed()) | ||
); | ||
int promo = (youngEvent.getPreUsed() - youngEvent.getPostUsed()) - (event.getPreUsed() - event.getPostUsed()); | ||
if (promo >= 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will probably only hide the error and still not produce correct promotion numbers.
"[12.034s][info][gc,phases ] GC(9) Evacuate Collection Set: 4.4ms\n" + | ||
"[12.034s][info][gc,phases ] GC(9) Post Evacuate Collection Set: 0.5ms\n" + | ||
"[12.034s][info][gc,phases ] GC(9) Other: 0.2ms\n" + | ||
"[12.034s][info][gc,heap ] GC(9) Eden regions: 143->0(142)\n" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think your test data is not correct. At least the parser does not read it correctly. If you add following lines top your test you will see that pre used of young is 0 but should be 143M.
assertThat("pre", model.get(0).getPreUsed(), is(162*1024)); // pass
assertThat("pre", model.get(0).getPostUsed(), is(19*1024)); // pass
AbstractGCEvent<?> event = model.get(0).getPhases().get(0);
assertThat("young pre", event.getGeneration(), is(AbstractGCEvent.Generation.YOUNG)); // pass
assertThat("young pre", event.getPreUsed(), is(143*1024)); // fail
assertThat("young pre", event.getPostUsed(), is(0L)); // pass
Your example would not produce the desired error if parsed correctly:
int young = 143 - 0; // 143
int all = 162 - 19; // 143
int promotion = young - all; // 0
The format in this test differs from the format used in your issue #235 that produces the error in "real life".
Edit: The formats are the same. The test does still not correctly parse the entry. Maybe it is missing some header like [0.011s][info][gc,heap] Heap region size: 1M
?
Fixes #235