Skip to content

Commit

Permalink
Merge pull request #18339 from flooxo/master
Browse files Browse the repository at this point in the history
Removed duplicate System.gc() in test
  • Loading branch information
llxia committed Nov 8, 2023
2 parents 70f5655 + 1b76dbd commit 0a0620e
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 25 deletions.
Expand Up @@ -67,12 +67,8 @@ public static boolean isFinalized(String name) {

protected static void thoroughGCandFinalization() {
System.gc();
System.gc();
System.runFinalization();
System.runFinalization();
System.gc();
System.gc();
System.runFinalization();
System.runFinalization();
}

Expand Down
Expand Up @@ -114,7 +114,6 @@ protected void setUp() throws Exception {
public final void testGetLastGcInfo() {
AssertJUnit.assertTrue(gcb instanceof com.sun.management.GarbageCollectorMXBean);
System.gc();
System.gc();
AssertJUnit.assertTrue(((com.sun.management.GarbageCollectorMXBean)gcb).getLastGcInfo() != null);
}

Expand Down
Expand Up @@ -65,7 +65,6 @@ private void runTest(byte[] classBytes, String className) {
new RuntimeException("Error calling method: getCondy()" + e);
}
System.gc();
System.gc();
try {
Method condyMethod = condyClass.getDeclaredMethod("getCondy");
Object result2 = "Result2 initial value";
Expand Down
Expand Up @@ -24,7 +24,6 @@
public class CreateDumps {

public static void main(String[] args) {
System.gc();
System.gc();
com.ibm.jvm.Dump.HeapDump();
com.ibm.jvm.Dump.SystemDump();
Expand Down
Expand Up @@ -62,12 +62,8 @@ public void runTest() throws Exception {

protected static void thoroughGCandFinalization() {
System.gc();
System.gc();
System.runFinalization();
System.runFinalization();
System.gc();
System.gc();
System.runFinalization();
System.runFinalization();
}

Expand Down
Expand Up @@ -51,7 +51,6 @@ public HashCodeTestParent(int mode) {
public void gc() {
switch (mode) {
case MODE_SYSTEM_GC:
System.gc();
System.gc();
break;
case MODE_SCAVENGE:
Expand Down
Expand Up @@ -339,7 +339,6 @@ static public void testGCFlattenedPoint2DArray() throws Throwable {
Array.set(arrayObject, i, point2D);
}

System.gc();
System.gc();

Object value = Array.get(arrayObject, 0);
Expand All @@ -354,7 +353,6 @@ static public void testGCFlattenedValueArrayWithSingleAlignment() throws Throwab
Array.set(array, i, object);
}

System.gc();
System.gc();

for (int i = 0; i < 4; i++) {
Expand All @@ -371,7 +369,6 @@ static public void testGCFlattenedValueArrayWithObjectAlignment() throws Throwab
Array.set(array, i, object);
}

System.gc();
System.gc();

for (int i = 0; i < 4; i++) {
Expand All @@ -388,7 +385,6 @@ static public void testGCFlattenedValueArrayWithLongAlignment() throws Throwable
Array.set(array, i, object);
}

System.gc();
System.gc();

for (int i = 0; i < genericArraySize; i++) {
Expand All @@ -405,7 +401,6 @@ static public void testGCFlattenedLargeObjectArray() throws Throwable {
Array.set(arrayObject, i, largeObjectRef);
}

System.gc();
System.gc();

Object value = Array.get(arrayObject, 0);
Expand All @@ -416,14 +411,12 @@ static public void testGCFlattenedMegaObjectArray() throws Throwable {
Object arrayObject = Array.newInstance(megaObjectValueClass, 4);
Object megaObjectRef = createMegaObject(new Object());

System.gc();
System.gc();

for (int i = 0; i < 4; i++) {
Array.set(arrayObject, i, megaObjectRef);
}
System.gc();
System.gc();

Object value = Array.get(arrayObject, 0);
}
Expand Down Expand Up @@ -2188,7 +2181,6 @@ static public void testCreateLargeNumberOfPoint2D() throws Throwable {
MethodHandle makePoint2DX = lookup.findStatic(point2DXClass, "makeValueGeneric", MethodType.methodType(Object.class, Object.class, Object.class));
if (0 == (valueIndex % 100)) {
System.gc();
System.gc();
}
}
}
Expand Down Expand Up @@ -2556,7 +2548,6 @@ static public void testValueWithLongAlignmentGCScanning() throws Throwable {
longAlignmentArrayList.add(newLongAlignmentArray);
}

System.gc();
System.gc();

for (int i = 0; i < objectGCScanningIterationCount; i++) {
Expand All @@ -2582,7 +2573,6 @@ static public void testValueWithObjectAlignmentGCScanning() throws Throwable {
objectAlignmentArrayList.add(newObjectAlignmentArray);
}

System.gc();
System.gc();

for (int i = 0; i < objectGCScanningIterationCount; i++) {
Expand All @@ -2608,7 +2598,6 @@ static public void testValueWithSingleAlignmentGCScanning() throws Throwable {
singleAlignmentArrayList.add(newSingleAlignmentArray);
}

System.gc();
System.gc();

for (int i = 0; i < objectGCScanningIterationCount; i++) {
Expand Down
Expand Up @@ -68,11 +68,9 @@ public static void main(String[] args)
_array = null;
System.gc();
System.gc();
System.gc();
long tempMem = runtime.totalMemory();
System.gc();
System.gc();
System.gc();
long tempMem2 = runtime.totalMemory();

if (verbose)
Expand Down

0 comments on commit 0a0620e

Please sign in to comment.