com/oracle/jfr/gc/HeapSummaryEventAllGcs.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/com/oracle/jfr/gc/HeapSummaryEventAllGcs.java Thu May 2 15:03:56 2013
--- new/com/oracle/jfr/gc/HeapSummaryEventAllGcs.java Thu May 2 15:03:56 2013
*** 14,26 ****
--- 14,26 ----
import static jrockit.Asserts.*;
public class HeapSummaryEventAllGcs {
! private static long lastHeapGcId = -1;
! private static long lastPSGcId = -1;
! private static long lastPermGcId = -1;
! private static int lastHeapGcId = -1;
! private static int lastPSGcId = -1;
! private static int lastPermGcId = -1;
public static void test(GarbageCollectionConfiguration.YoungCollector yc,
GarbageCollectionConfiguration.OldCollector oc) throws Exception {
if (!GarbageCollectionConfiguration.usesGCs(yc, oc)) {
*** 96,128 ****
--- 96,128 ----
checkVirtualSpace(permSpace);
checkSpace(objectSpace);
}
private static void checkHeapGcId(FLREvent evt) {
! long gcId = (long) evt.getValue("gcId");
! int gcId = (int) evt.getValue("gcId");
FLRStruct when = ((FLRStruct) evt.getResolvedValue("when"));
if ("Before GC".equals(when.getValue("when"))) {
assertGT(gcId, lastHeapGcId, "gcId should be increasing");
lastHeapGcId = gcId;
} else {
assertEquals(gcId, lastHeapGcId, "After should have same gcId as last Before event");
}
}
private static void checkPSGcId(FLREvent evt) {
! long gcId = (long) evt.getValue("gcId");
! int gcId = (int) evt.getValue("gcId");
FLRStruct when = ((FLRStruct) evt.getResolvedValue("when"));
if ("Before GC".equals(when.getValue("when"))) {
assertGT(gcId, lastPSGcId, "gcId should be increasing");
lastPSGcId = gcId;
} else {
assertEquals(gcId, lastPSGcId, "After should have same gcId as last Before event");
}
}
private static void checkPermGcId(FLREvent evt) {
! long gcId = (long) evt.getValue("gcId");
! int gcId = (int) evt.getValue("gcId");
FLRStruct when = ((FLRStruct) evt.getResolvedValue("when"));
if ("Before GC".equals(when.getValue("when"))) {
assertGT(gcId, lastPermGcId, "gcId should be increasing");
lastPermGcId = gcId;
} else {
*** 230,246 ****
--- 230,246 ----
* @return The remaining events when the events with the lowest and highest
* gcId have been removed.
*/
private static List<FLREvent> removeFirstAndLastGC(List<FLREvent> allEvents) {
List<FLREvent> filteredEvents = new ArrayList<FLREvent>();
! long minGcId = Long.MAX_VALUE;
! long maxGcId = Long.MIN_VALUE;
! int minGcId = Integer.MAX_VALUE;
! int maxGcId = Integer.MIN_VALUE;
// Find min/max gcId
for (FLREvent event : allEvents) {
try {
! long gcId = ((Long) event.getValue("gcId")).longValue();
! int gcId = ((Integer) event.getValue("gcId")).intValue();
if (gcId < minGcId) {
minGcId = gcId;
}
if (gcId > maxGcId) {
maxGcId = gcId;
*** 251,261 ****
--- 251,261 ----
}
// Add all events execpt those with gcId = min/max gcId
for (FLREvent event : allEvents) {
try {
! long gcId = ((Long) event.getValue("gcId")).longValue();
! int gcId = ((Integer) event.getValue("gcId")).intValue();
if (gcId == minGcId || gcId == maxGcId) {
continue;
}
} catch (NoSuchElementException t) {
// Expected error.
com/oracle/jfr/gc/HeapSummaryEventAllGcs.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File