Merge
This commit is contained in:
commit
dd9df0a16c
@ -38,6 +38,61 @@ import java.util.function.Consumer;
|
|||||||
* referenced objects after GCs
|
* referenced objects after GCs
|
||||||
*/
|
*/
|
||||||
public enum GC {
|
public enum GC {
|
||||||
|
CMC {
|
||||||
|
@Override
|
||||||
|
public Runnable get() {
|
||||||
|
return () -> {
|
||||||
|
Helpers.waitTillCMCFinished(WHITE_BOX, 0);
|
||||||
|
WHITE_BOX.g1StartConcMarkCycle();
|
||||||
|
Helpers.waitTillCMCFinished(WHITE_BOX, 0);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public Consumer<ReferenceInfo<Object[]>> getChecker() {
|
||||||
|
return getCheckerImpl(false, false, true, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> shouldContain() {
|
||||||
|
return Arrays.asList(GCTokens.WB_INITIATED_CMC);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> shouldNotContain() {
|
||||||
|
return Arrays.asList(GCTokens.WB_INITIATED_YOUNG_GC, GCTokens.WB_INITIATED_MIXED_GC,
|
||||||
|
GCTokens.FULL_GC, GCTokens.YOUNG_GC);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
CMC_NO_SURV_ROOTS {
|
||||||
|
@Override
|
||||||
|
public Runnable get() {
|
||||||
|
return () -> {
|
||||||
|
WHITE_BOX.youngGC();
|
||||||
|
Helpers.waitTillCMCFinished(WHITE_BOX, 0);
|
||||||
|
WHITE_BOX.youngGC();
|
||||||
|
Helpers.waitTillCMCFinished(WHITE_BOX, 0);
|
||||||
|
|
||||||
|
WHITE_BOX.g1StartConcMarkCycle();
|
||||||
|
Helpers.waitTillCMCFinished(WHITE_BOX, 0);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public Consumer<ReferenceInfo<Object[]>> getChecker() {
|
||||||
|
return getCheckerImpl(true, false, true, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> shouldContain() {
|
||||||
|
return Arrays.asList(GCTokens.WB_INITIATED_CMC);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> shouldNotContain() {
|
||||||
|
return Arrays.asList(GCTokens.WB_INITIATED_MIXED_GC,
|
||||||
|
GCTokens.FULL_GC, GCTokens.YOUNG_GC);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
YOUNG_GC {
|
YOUNG_GC {
|
||||||
@Override
|
@Override
|
||||||
@ -60,6 +115,7 @@ public enum GC {
|
|||||||
GCTokens.CMC, GCTokens.YOUNG_GC);
|
GCTokens.CMC, GCTokens.YOUNG_GC);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
FULL_GC {
|
FULL_GC {
|
||||||
@Override
|
@Override
|
||||||
public Runnable get() {
|
public Runnable get() {
|
||||||
|
@ -31,6 +31,13 @@ The test checks that after different type of GC unreachable objects behave as ex
|
|||||||
|
|
||||||
3. Full GC with memory pressure - weakly and softly referenced non-humongous and humongous objects are collected.
|
3. Full GC with memory pressure - weakly and softly referenced non-humongous and humongous objects are collected.
|
||||||
|
|
||||||
|
4. CMC - weakly referenced non-humongous objects are collected, other objects are not collected since weak references
|
||||||
|
from Young Gen is handled as strong during CMC.
|
||||||
|
|
||||||
|
5. CMC_NO_SURV_ROOTS - weakly referenced non-humongous and humongous objects are collected, softly referenced
|
||||||
|
non-humongous and humongous objects are not collected since we make 2 Young GC to promote all
|
||||||
|
weak references to Old Gen.
|
||||||
|
|
||||||
The test gets gc type as a command line argument.
|
The test gets gc type as a command line argument.
|
||||||
Then the test allocates object graph in heap (currently testing scenarios are pre-generated and stored in
|
Then the test allocates object graph in heap (currently testing scenarios are pre-generated and stored in
|
||||||
TestcaseData.getPregeneratedTestcases()) with TestObjectGraphAfterGC::allocateObjectGraph.
|
TestcaseData.getPregeneratedTestcases()) with TestObjectGraphAfterGC::allocateObjectGraph.
|
||||||
|
@ -77,6 +77,14 @@ import java.util.stream.Collectors;
|
|||||||
* -XX:G1HeapRegionSize=1M -Xlog:gc=info:file=TestObjectGraphAfterGC_FULL_GC_MEMORY_PRESSURE.gc.log
|
* -XX:G1HeapRegionSize=1M -Xlog:gc=info:file=TestObjectGraphAfterGC_FULL_GC_MEMORY_PRESSURE.gc.log
|
||||||
* gc.g1.humongousObjects.objectGraphTest.TestObjectGraphAfterGC FULL_GC_MEMORY_PRESSURE
|
* gc.g1.humongousObjects.objectGraphTest.TestObjectGraphAfterGC FULL_GC_MEMORY_PRESSURE
|
||||||
*
|
*
|
||||||
|
* @run main/othervm -Xms200M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
|
||||||
|
* -XX:G1HeapRegionSize=1M -Xlog:gc=info:file=TestObjectGraphAfterGC_CMC.gc.log -XX:MaxTenuringThreshold=16
|
||||||
|
* gc.g1.humongousObjects.objectGraphTest.TestObjectGraphAfterGC CMC
|
||||||
|
*
|
||||||
|
* @run main/othervm -Xms200M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
|
||||||
|
* -XX:G1HeapRegionSize=1M -Xlog:gc=info:file=TestObjectGraphAfterGC_CMC_NO_SURV_ROOTS.gc.log -XX:MaxTenuringThreshold=1
|
||||||
|
* gc.g1.humongousObjects.objectGraphTest.TestObjectGraphAfterGC CMC_NO_SURV_ROOTS
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user