equal
deleted
inserted
replaced
23 |
23 |
24 package gc.g1.humongousObjects; |
24 package gc.g1.humongousObjects; |
25 |
25 |
26 import jdk.test.lib.Utils; |
26 import jdk.test.lib.Utils; |
27 import sun.hotspot.WhiteBox; |
27 import sun.hotspot.WhiteBox; |
|
28 |
|
29 import static java.lang.ref.Reference.reachabilityFence; |
28 |
30 |
29 import java.util.LinkedList; |
31 import java.util.LinkedList; |
30 import java.util.List; |
32 import java.util.List; |
31 import java.util.Random; |
33 import java.util.Random; |
32 import java.util.stream.Collectors; |
34 import java.util.stream.Collectors; |
137 }, |
139 }, |
138 |
140 |
139 // Dead object allocation |
141 // Dead object allocation |
140 () -> { |
142 () -> { |
141 int size = RND.nextInt(DEAD_OBJECT_MAX_SIZE); |
143 int size = RND.nextInt(DEAD_OBJECT_MAX_SIZE); |
142 byte[] deadObject = new byte[size]; |
144 reachabilityFence(new byte[size]); |
143 }, |
145 }, |
144 |
146 |
145 // Check |
147 // Check |
146 () -> { |
148 () -> { |
147 List<byte[]> wrongHumongousAllocations = liveObjects.stream() |
149 List<byte[]> wrongHumongousAllocations = liveObjects.stream() |