Skip to content

Commit

Permalink
Adapt to changes in Shenandoah algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
ophillan committed Jul 1, 2017
1 parent df1d147 commit 12f8733
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public class DataReaderShenandoah extends AbstractDataReader {
"[gc,start", "[gc,ergo", "[gc,stringtable", "[gc,init", "[gc,heap", "[pagesize", "[class", "[os", "[startuptime",
"[os,thread", "[gc,heap,exit", "Cancelling concurrent GC: Allocation Failure", "Phase ",
"[gc,stats", "[biasedlocking", "[logging", "[verification", "[modules,startuptime", "[safepoint", "[stacktrace",
"[exceptions", "thrown", "at bci", "for thread");
"[exceptions", "thrown", "at bci", "for thread", "[module,load", "[module,startuptime");

protected DataReaderShenandoah(GCResource gcResource, InputStream in) throws UnsupportedEncodingException {
super(gcResource, in);
Expand All @@ -96,26 +96,44 @@ private AbstractGCEvent<?> parseShenandoahEvent(String line) {
if (noHeapMatcher.find()) {
if (line.contains("Init Mark")) {
setEventTypes(event, AbstractGCEvent.Type.SHEN_STW_INIT_MARK);
} else if (line.contains("Concurrent reset bitmaps")) {
setEventTypes(event, AbstractGCEvent.Type.SHEN_CONCURRENT_CONC_RESET);
} else if (line.contains("Pause Init Update Refs")) {
setEventTypes(event, AbstractGCEvent.Type.SHEN_STW_INIT_UPDATE_REFS);
} else {
getLogger().warning("Failed to match line with no heap info: " + line);
}
event.setPause(Double.parseDouble(noHeapMatcher.group(NO_HEAP_DURATION)));
event.setTimestamp(Double.parseDouble(noHeapMatcher.group(NO_HEAP_TIMESTAMP)));
} else if (withHeapMatcher.find()) {
if (line.contains("Final Mark")) {
setEventTypes(event, AbstractGCEvent.Type.SHEN_STW_FINAL_MARK);
} else if (line.contains("Concurrent marking")) {
setEventTypes(event, AbstractGCEvent.Type.SHEN_CONCURRENT_CONC_MARK);
event.setConcurrency(true);
} else if (line.contains("Concurrent evacuation")) {
setEventTypes(event, AbstractGCEvent.Type.SHEN_CONCURRENT_CONC_EVAC);
event.setConcurrency(true);
} else if (line.contains("Pause Full (Allocation Failure)")) {
// Concurrent events
if (line.contains("Concurrent")) {
if (line.contains("Concurrent marking")) {
setEventTypes(event, AbstractGCEvent.Type.SHEN_CONCURRENT_CONC_MARK);
event.setConcurrency(true);
} else if (line.contains("Concurrent evacuation")) {
setEventTypes(event, AbstractGCEvent.Type.SHEN_CONCURRENT_CONC_EVAC);
event.setConcurrency(true);
} else if (line.contains("Concurrent update references")) {
setEventTypes(event, AbstractGCEvent.Type.SHEN_CONCURRENT_CONC_UPDATE_REFS);
event.setConcurrency(true);
} else if (line.contains("Concurrent reset bitmaps")) {
setEventTypes(event, AbstractGCEvent.Type.SHEN_CONCURRENT_CONC_RESET_BITMAPS);
event.setConcurrency(true);
} else if (line.contains("Concurrent precleaning")) {
setEventTypes(event, AbstractGCEvent.Type.SHEN_CONCURRENT_PRECLEANING);
event.setConcurrency(true);
}
}
// STW events
else {
if (line.contains("Final Mark")) {
setEventTypes(event, AbstractGCEvent.Type.SHEN_STW_FINAL_MARK);
} else if (line.contains("Pause Full (Allocation Failure)")) {
setEventTypes(event, AbstractGCEvent.Type.SHEN_STW_ALLOC_FAILURE);
} else {
} else if (line.contains("Pause Final Update Refs")) {
setEventTypes(event, AbstractGCEvent.Type.SHEN_STW_FINAL_UPDATE_REFS);
} else {
getLogger().warning("Failed to match line with heap info: " + line);
}
}
event.setPause(Double.parseDouble(withHeapMatcher.group(WITH_HEAP_DURATION)));
event.setTimestamp(Double.parseDouble(withHeapMatcher.group(WITH_HEAP_TIMESTAMP)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,14 +505,18 @@ public String toString() {
public static final Type G1_CONCURRENT_CLEANUP_END = new Type("GC concurrent-cleanup-end", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC_PAUSE);

// Shenandoah types of Generation.TENURED since Generation.ALL gets ignored apparently (GCEvent.java line 56)
// STW pauses
public static final Type SHEN_STW_INIT_MARK = new Type("GC Pause Initial Mark (STW pause) initial-mark", Generation.TENURED, Concurrency.SERIAL, GcPattern.GC_PAUSE);
// STW pause events
public static final Type SHEN_STW_INIT_MARK = new Type("GC Pause Initial Mark (STW pause)", Generation.TENURED, Concurrency.SERIAL, GcPattern.GC_PAUSE);
public static final Type SHEN_STW_FINAL_MARK = new Type("GC Pause Final Mark (STW pause)", Generation.TENURED, Concurrency.SERIAL, GcPattern.GC_PAUSE);
public static final Type SHEN_STW_INIT_UPDATE_REFS = new Type("GC Pause Init Update Refs (STW pause)", Generation.TENURED, Concurrency.SERIAL, GcPattern.GC_PAUSE);
public static final Type SHEN_STW_FINAL_UPDATE_REFS = new Type("GC Pause Final Update Refs", Generation.TENURED, Concurrency.SERIAL, GcPattern.GC_PAUSE);
public static final Type SHEN_STW_ALLOC_FAILURE = new Type("GC Pause Full (Allocation Failure)", Generation.TENURED, Concurrency.SERIAL, GcPattern.GC_PAUSE);

// Concurrent events
public static final Type SHEN_CONCURRENT_CONC_MARK = new Type("GC Concurrent marking", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC);
public static final Type SHEN_CONCURRENT_CONC_EVAC = new Type("GC Concurrent evacuation", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC);
public static final Type SHEN_CONCURRENT_CONC_RESET = new Type("GC Concurret reset bitmaps", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC);
public static final Type SHEN_CONCURRENT_CONC_RESET_BITMAPS = new Type("GC Concurrent reset bitmaps", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC);
public static final Type SHEN_CONCURRENT_CONC_UPDATE_REFS = new Type("GC Concurrent update references", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC);
public static final Type SHEN_CONCURRENT_PRECLEANING = new Type("GC Concurrent precleaning", Generation.TENURED, Concurrency.CONCURRENT, GcPattern.GC);

// IBM Types
// TODO: are scavenge always young only??
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/openjdk/SampleShenandoahBasic.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
[193.496s][info][gc,start ] GC(57) Concurrent evacuation
[193.498s][info][gc ] GC(57) Concurrent evacuation 88M->92M(128M) 2.026ms
[193.499s][info][gc,start ] GC(57) Concurrent reset bitmaps
[193.499s][info][gc ] GC(57) Concurrent reset bitmaps 0.282ms
[193.499s][info][gc ] GC(57) Concurrent reset bitmaps 33M->33M(128M) 0.072ms

0 comments on commit 12f8733

Please sign in to comment.