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

Fix for gctoolkit #352 (Generational Heap Parser fails to recognize parallel gc lines) #362

Merged
merged 2 commits into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1578,7 +1578,7 @@ public void cmfSimple(GCLogTrace trace, String line) {
//939.183: [GC [PSYoungGen: 523744K->844K(547584K)] 657668K->135357K(1035008K), 0.0157986 secs] [Times: user=0.30 sys=0.01, real=0.02 secs]
public void psYoungGen(GCLogTrace trace, String line) {
PSYoungGen collection = new PSYoungGen(getClock(), trace.gcCause(), trace.getDoubleGroup(trace.groupCount()));
collection.add(trace.getOccupancyBeforeAfterWithMemoryPoolSizeSummary(5), getTotalOccupancyBeforeAfterWithTotalHeapPoolSizeSummary(trace, 11));
collection.add(trace.getOccupancyBeforeAfterWithMemoryPoolSizeSummary(8), getTotalOccupancyBeforeAfterWithTotalHeapPoolSizeSummary(trace, 14));
collection.add(extractCPUSummary(line));
publish(collection);
}
Expand Down Expand Up @@ -1714,7 +1714,7 @@ public void psDetailsWithTenuring(GCLogTrace trace, String line) {
//GC-- indicated a promotion failed
public void psFailure(GCLogTrace trace, String line) {
PSYoungGen collection = new PSYoungGen(getClock(), GCCause.PROMOTION_FAILED, trace.getDoubleGroup(trace.groupCount()));
collection.add(trace.getOccupancyBeforeAfterWithMemoryPoolSizeSummary(5), getTotalOccupancyBeforeAfterWithTotalHeapPoolSizeSummary(trace, 11));
collection.add(trace.getOccupancyBeforeAfterWithMemoryPoolSizeSummary(8), getTotalOccupancyBeforeAfterWithTotalHeapPoolSizeSummary(trace, 14));
}

public void psYoungAdaptiveSizePolicy(GCLogTrace trace, String line) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,25 @@ public void basicLogTest() {
assertEquals(9.089,getParser().diary.getTimeOfFirstEvent().toSeconds());
}


@Test
// jlittle-ptc: Added to validate changes in https://github.com/microsoft/gctoolkit/issues/352
// Fails without changes, passes with changes.
public void parallelYoungGenTest() {
String[] lines = {
"103.387: [GC [PSYoungGen: 138710K->17821K(154112K)] 138710K->17821K(506368K), 0.1040105 secs]",
"135.734: [GC [PSYoungGen: 149917K->22007K(154112K)] 149917K->30709K(506368K), 0.2773358 secs]",
"147.102: [GC [PSYoungGen: 154103K->22015K(154112K)] 162805K->57046K(506368K), 0.1371908 secs]",
"156.646: [GC [PSYoungGen: 154111K->22001K(152320K)] 189142K->84340K(504576K), 0.1508722 secs]",
"5989.323: [Full GC [PSYoungGen: 384K->0K(46208K)] [PSOldGen: 351520K->291209K(675840K)] 351904K->291209K(722048K) [PSPermGen: 46324K->46324K(94208K)], 5.6953760 secs]",
"12023.260: [Full GC [PSYoungGen: 1463K->0K(172160K)] [PSOldGen: 674819K->546126K(917504K)] 676283K->546126K(1089664K) [PSPermGen: 75971K->75971K(126976K)], 12.4914242 secs]",
"132380.027: [Full GC [PSYoungGen: 388637K->0K(581376K)] [PSOldGen: 1707204K->1099190K(1708032K)] 2095842K->1099190K(2289408K) [PSPermGen: 103975K->103975K(122880K)], 25.3055946 secs]"
};

List<JVMEvent> jvmEvents = feedParser(lines);
assertEquals(7, jvmEvents.size());
assertEquals(103.387, getParser().diary.getTimeOfFirstEvent().toSeconds());
}

@Override
protected Diarizer diarizer() {
return new PreUnifiedDiarizer();
Expand Down