if (abstractEvent instanceof ConcurrentGCEvent) {
ConcurrentGCEvent concEvent = (ConcurrentGCEvent)abstractEvent;
concurrentGCEvents.add(concEvent);
DoubleData pauses = getDoubleData(concEvent.getExtendedType().getName(), concurrentGcEventPauses);
pauses.add(concEvent.getPause());
}
else if (abstractEvent instanceof GCEvent) {
// collect statistics about all stop the world events
GCEvent event = (GCEvent) abstractEvent;
updateHeapSizes(event);
updateGcPauseInterval(event);
updatePromotion(event);
if (event.isInitialMark()) {
updateInitiatingOccupancyFraction(event);
}
if (size() > 1 && allEvents.get(allEvents.size() - 2).isConcurrentCollectionEnd()) {
updatePostConcurrentCycleUsedSizes(event);
}
freedMemory += event.getPreUsed() - event.getPostUsed();
if (!event.isFull()) {
// make a difference between stop the world events, which only collect from some generations...
DoubleData pauses = getDoubleData(event.getTypeAsString(), gcEventPauses);
pauses.add(event.getPause());
gcEvents.add(event);
postGCUsedMemory.add(event.getPostUsed());
freedMemoryByGC.add(event.getPreUsed() - event.getPostUsed());
currentNoFullGCEvents.add(event);
currentPostGCSlope.addPoint(event.getTimestamp(), event.getPostUsed());
currentRelativePostGCIncrease.addPoint(currentRelativePostGCIncrease.getPointCount(), event.getPostUsed());
gcPause.add(event.getPause());
}
else {
// ... as opposed to all generations
DoubleData pauses = getDoubleData(event.getTypeAsString(), fullGcEventPauses);
pauses.add(event.getPause());
fullGCEvents.add(event);
postFullGCUsedHeap.add(event.getPostUsed());
int freed = event.getPreUsed() - event.getPostUsed();
freedMemoryByFullGC.add(freed);
fullGCPause.add(event.getPause());
postFullGCSlope.addPoint(event.getTimestamp(), event.getPostUsed());
relativePostFullGCIncrease.addPoint(relativePostFullGCIncrease.getPointCount(), event.getPostUsed());
// process no full-gc run data
if (currentPostGCSlope.hasPoints()) {
// make sure we have at least _two_ data points
if (currentPostGCSlope.isLine()) {
postGCSlope.add(currentPostGCSlope.slope(), currentPostGCSlope.getPointCount());
relativePostGCIncrease.add(currentRelativePostGCIncrease.slope(), currentRelativePostGCIncrease.getPointCount());
}
currentPostGCSlope.reset();
currentRelativePostGCIncrease.reset();
}
}
}
else if (abstractEvent instanceof VmOperationEvent) {
adjustPause((VmOperationEvent) abstractEvent);
if (abstractEvent.getTimestamp() < 0.000001) {
setTimeStamp((VmOperationEvent) abstractEvent);
}
vmOperationPause.add(abstractEvent.getPause());
vmOperationEvents.add(abstractEvent);
DoubleData vmOpPauses = getDoubleData(abstractEvent.getTypeAsString(), vmOperationEventPauses);
vmOpPauses.add(abstractEvent.getPause());
}
if (size() == 1 || (size() > 1 && abstractEvent.getTimestamp() > 0.0)) {
// timestamp == 0 is only valid, if it is the first event.
// sometimes, no timestamp is present, because the line is mixed -> don't count these here