author | ctornqvi |
Fri, 19 Aug 2016 10:06:30 -0400 | |
changeset 40631 | ed82623d7831 |
parent 39414 | 4adf52148100 |
child 41705 | 332239c052cc |
permissions | -rw-r--r-- |
35523
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
1 |
/* |
39414
4adf52148100
8160088: update hotspot tests depending on GC to use @requires vm.gc.X
dfazunen
parents:
38152
diff
changeset
|
2 |
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. |
35523
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
4 |
* |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
8 |
* |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
13 |
* accompanied this code). |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
14 |
* |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
18 |
* |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
21 |
* questions. |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
22 |
* |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
23 |
*/ |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
24 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
25 |
package gc.g1.humongousObjects; |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
26 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
27 |
import gc.testlibrary.Helpers; |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
28 |
import jdk.test.lib.Asserts; |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
29 |
import jdk.test.lib.Utils; |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
30 |
import sun.hotspot.WhiteBox; |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
31 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
32 |
import java.io.PrintStream; |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
33 |
import java.math.BigInteger; |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
34 |
import java.util.ArrayList; |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
35 |
import java.util.List; |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
36 |
import java.util.Random; |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
37 |
import java.util.stream.Collectors; |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
38 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
39 |
/** |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
40 |
* @test TestHumongousMovement |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
41 |
* @summary Checks that Humongous objects are not moved during GC |
39414
4adf52148100
8160088: update hotspot tests depending on GC to use @requires vm.gc.X
dfazunen
parents:
38152
diff
changeset
|
42 |
* @requires vm.gc.G1 |
40631
ed82623d7831
8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents:
39414
diff
changeset
|
43 |
* @library /test/lib / |
38152
80e5da81fb2c
8154258: [TESTBUG] Various serviceability tests fail compilation
dsamersoff
parents:
35523
diff
changeset
|
44 |
* @modules java.base/jdk.internal.misc |
35523
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
45 |
* @modules java.management |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
46 |
* @build sun.hotspot.WhiteBox |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
47 |
* @run driver ClassFileInstaller sun.hotspot.WhiteBox |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
48 |
* sun.hotspot.WhiteBox$WhiteBoxPermission |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
49 |
* @run main/othervm -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
50 |
* -XX:G1HeapRegionSize=1M -Xms200m -Xmx200m -XX:InitiatingHeapOccupancyPercent=100 |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
51 |
* -Xlog:gc=info:file=TestHumongousMovement.log |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
52 |
* gc.g1.humongousObjects.TestHumongousMovement |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
53 |
*/ |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
54 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
55 |
public class TestHumongousMovement { |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
56 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
57 |
private static class AllocationData { |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
58 |
private final byte[] allocation; |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
59 |
public final BigInteger objectAddress; |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
60 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
61 |
public AllocationData(byte[] byteArray) { |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
62 |
allocation = byteArray; |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
63 |
objectAddress = new BigInteger(Long.toUnsignedString((WB.getObjectAddress(allocation)))); |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
64 |
} |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
65 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
66 |
public boolean isAddressChanged() { |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
67 |
return !new BigInteger(Long.toUnsignedString((WB.getObjectAddress(allocation)))).equals(objectAddress); |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
68 |
} |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
69 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
70 |
public void printDetails(PrintStream out) { |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
71 |
BigInteger objectAddressAfterGC = |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
72 |
new BigInteger(Long.toUnsignedString((WB.getObjectAddress(allocation)))); |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
73 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
74 |
out.println(String.format("Object stored address = %d\nObject address after GC = %d\n" |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
75 |
+ "They are %sequals", objectAddress, |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
76 |
objectAddressAfterGC, !objectAddress.equals(objectAddressAfterGC) ? "not " : "")); |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
77 |
} |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
78 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
79 |
} |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
80 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
81 |
private static final WhiteBox WB = WhiteBox.getWhiteBox(); |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
82 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
83 |
// How many allocated humongous objects should be deleted |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
84 |
private static final double HUMONGOUS_OBJECTS_DELETED_FACTOR = 0.5D; |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
85 |
// How many of free g1 regions should be used for humongous allocations |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
86 |
private static final double ALLOCATED_HUMONGOUS_REGIONS_FACTOR = 0.25D; |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
87 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
88 |
public static void main(String[] args) { |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
89 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
90 |
int g1RegionSize = WB.g1RegionSize(); |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
91 |
int byteArrayMemoryOverhead = Helpers.detectByteArrayAllocationOverhead(); |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
92 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
93 |
System.out.println("Total " + WB.g1NumMaxRegions() + " regions"); |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
94 |
System.out.println("Total " + WB.g1NumFreeRegions() + " free regions"); |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
95 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
96 |
int regionsToAllocate = (int) (WB.g1NumFreeRegions() * ALLOCATED_HUMONGOUS_REGIONS_FACTOR); |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
97 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
98 |
// Sanity check |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
99 |
Asserts.assertGreaterThan(regionsToAllocate, 0, "Test Bug: no regions to allocate"); |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
100 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
101 |
System.out.println("Allocating " + regionsToAllocate + " humongous objects, each 90% of g1 region size"); |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
102 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
103 |
List<AllocationData> allocations = new ArrayList<>(); |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
104 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
105 |
// 90 % of maximum byte[] that takes one region |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
106 |
int hSize = (int) ((g1RegionSize - byteArrayMemoryOverhead) * 0.9); |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
107 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
108 |
// Sanity check |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
109 |
Asserts.assertGreaterThan(hSize, g1RegionSize / 2, "Test Bug: allocation size is not humongous"); |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
110 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
111 |
for (int i = 0; i < regionsToAllocate; ++i) { |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
112 |
allocations.add(new AllocationData(new byte[hSize])); |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
113 |
} |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
114 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
115 |
Random rnd = Utils.getRandomInstance(); |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
116 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
117 |
int toDelete = (int) (allocations.size() * HUMONGOUS_OBJECTS_DELETED_FACTOR); |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
118 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
119 |
for (int i = 0; i < toDelete; ++i) { |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
120 |
allocations.remove(rnd.nextInt(allocations.size())); |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
121 |
} |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
122 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
123 |
WB.fullGC(); |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
124 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
125 |
List<AllocationData> movedObjects = allocations.stream() |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
126 |
.filter(AllocationData::isAddressChanged) |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
127 |
.collect(Collectors.toList()); |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
128 |
|
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
129 |
if (movedObjects.size() > 0) { |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
130 |
System.out.println("Test failed - some humongous objects moved after Full GC"); |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
131 |
movedObjects.stream().forEach(a -> a.printDetails(System.out)); |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
132 |
throw new Error("Test failed - some humongous objects moved after Full GC"); |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
133 |
} else { |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
134 |
System.out.println("Passed"); |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
135 |
} |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
136 |
} |
1c5fd47fcbdb
8132720: Add tests which checks that Humongous objects are not moved after Full GC
kzhaldyb
parents:
diff
changeset
|
137 |
} |