Skip to content

Commit 0a0620e

Browse files
authored
Merge pull request #18339 from flooxo/master
Removed duplicate System.gc() in test
2 parents 70f5655 + 1b76dbd commit 0a0620e

File tree

8 files changed

+0
-25
lines changed

8 files changed

+0
-25
lines changed

test/functional/JIT_Test/src/jit/test/finalizer/TestObject.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,8 @@ public static boolean isFinalized(String name) {
6767

6868
protected static void thoroughGCandFinalization() {
6969
System.gc();
70-
System.gc();
71-
System.runFinalization();
7270
System.runFinalization();
7371
System.gc();
74-
System.gc();
75-
System.runFinalization();
7672
System.runFinalization();
7773
}
7874

test/functional/JLM_Tests/src/org/openj9/test/java/lang/management/TestGarbageCollectorMXBean.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ protected void setUp() throws Exception {
114114
public final void testGetLastGcInfo() {
115115
AssertJUnit.assertTrue(gcb instanceof com.sun.management.GarbageCollectorMXBean);
116116
System.gc();
117-
System.gc();
118117
AssertJUnit.assertTrue(((com.sun.management.GarbageCollectorMXBean)gcb).getLastGcInfo() != null);
119118
}
120119

test/functional/Java11andUp/src/org/openj9/test/condy/GarbageCollectionCondyTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ private void runTest(byte[] classBytes, String className) {
6565
new RuntimeException("Error calling method: getCondy()" + e);
6666
}
6767
System.gc();
68-
System.gc();
6968
try {
7069
Method condyMethod = condyClass.getDeclaredMethod("getCondy");
7170
Object result2 = "Result2 initial value";

test/functional/RasapiTest/src/com/ibm/dump/tests/jdmpview_heapdump/CreateDumps.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
public class CreateDumps {
2525

2626
public static void main(String[] args) {
27-
System.gc();
2827
System.gc();
2928
com.ibm.jvm.Dump.HeapDump();
3029
com.ibm.jvm.Dump.SystemDump();

test/functional/VM_Test/src/j9vm/test/classunloading/ClassUnloadingTestParent.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,8 @@ public void runTest() throws Exception {
6262

6363
protected static void thoroughGCandFinalization() {
6464
System.gc();
65-
System.gc();
66-
System.runFinalization();
6765
System.runFinalization();
6866
System.gc();
69-
System.gc();
70-
System.runFinalization();
7167
System.runFinalization();
7268
}
7369

test/functional/VM_Test/src/j9vm/test/hash/HashCodeTestParent.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ public HashCodeTestParent(int mode) {
5151
public void gc() {
5252
switch (mode) {
5353
case MODE_SYSTEM_GC:
54-
System.gc();
5554
System.gc();
5655
break;
5756
case MODE_SCAVENGE:

test/functional/Valhalla/src_qtypes/org/openj9/test/lworld/ValueTypeTests.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,6 @@ static public void testGCFlattenedPoint2DArray() throws Throwable {
339339
Array.set(arrayObject, i, point2D);
340340
}
341341

342-
System.gc();
343342
System.gc();
344343

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

357-
System.gc();
358356
System.gc();
359357

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

374-
System.gc();
375372
System.gc();
376373

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

391-
System.gc();
392388
System.gc();
393389

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

408-
System.gc();
409404
System.gc();
410405

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

419-
System.gc();
420414
System.gc();
421415

422416
for (int i = 0; i < 4; i++) {
423417
Array.set(arrayObject, i, megaObjectRef);
424418
}
425419
System.gc();
426-
System.gc();
427420

428421
Object value = Array.get(arrayObject, 0);
429422
}
@@ -2188,7 +2181,6 @@ static public void testCreateLargeNumberOfPoint2D() throws Throwable {
21882181
MethodHandle makePoint2DX = lookup.findStatic(point2DXClass, "makeValueGeneric", MethodType.methodType(Object.class, Object.class, Object.class));
21892182
if (0 == (valueIndex % 100)) {
21902183
System.gc();
2191-
System.gc();
21922184
}
21932185
}
21942186
}
@@ -2556,7 +2548,6 @@ static public void testValueWithLongAlignmentGCScanning() throws Throwable {
25562548
longAlignmentArrayList.add(newLongAlignmentArray);
25572549
}
25582550

2559-
System.gc();
25602551
System.gc();
25612552

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

2585-
System.gc();
25862576
System.gc();
25872577

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

2611-
System.gc();
26122601
System.gc();
26132602

26142603
for (int i = 0; i < objectGCScanningIterationCount; i++) {

test/functional/cmdLineTests/gcRegressionTests/src/com/ibm/tests/garbagecollector/TestContractionMain.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,9 @@ public static void main(String[] args)
6868
_array = null;
6969
System.gc();
7070
System.gc();
71-
System.gc();
7271
long tempMem = runtime.totalMemory();
7372
System.gc();
7473
System.gc();
75-
System.gc();
7674
long tempMem2 = runtime.totalMemory();
7775

7876
if (verbose)

0 commit comments

Comments
 (0)