< prev index next >

test/hotspot/jtreg/gc/metaspace/TestMetaspacePerfCounters.java

Print this page

248         System.gc();
249         long after = getUsed(ns);
250 
251         assertGT(after, before);
252     }
253 
254     private static List<PerfCounter> countersInNamespace(String ns) throws Exception {
255         List<PerfCounter> counters = new ArrayList<>();
256         for (String name : counterNames) {
257             counters.add(PerfCounters.findByName(ns + "." + name));
258         }
259         return counters;
260     }
261 
262     private static Class<?> compileAndLoad(String name, String source) throws Exception {
263         byte[] byteCode = InMemoryJavaCompiler.compile(name, source);
264         return ByteCodeLoader.load(name, byteCode);
265     }
266 
267     private static boolean isUsingCompressedClassPointers() {
268         return Platform.is64bit() && InputArguments.contains("-XX:+UseCompressedClassPointers");
269     }
270 
271     private static long getMinCapacity(String ns) throws Exception {
272         return PerfCounters.findByName(ns + ".minCapacity").longValue();
273     }
274 
275     private static long getCapacity(String ns) throws Exception {
276         return PerfCounters.findByName(ns + ".capacity").longValue();
277     }
278 
279     private static long getMaxCapacity(String ns) throws Exception {
280         return PerfCounters.findByName(ns + ".maxCapacity").longValue();
281     }
282 
283     private static long getUsed(String ns) throws Exception {
284         return PerfCounters.findByName(ns + ".used").longValue();
285     }
286 
287     private static long currentGCCount() {
288         long gcCount = 0;

248         System.gc();
249         long after = getUsed(ns);
250 
251         assertGT(after, before);
252     }
253 
254     private static List<PerfCounter> countersInNamespace(String ns) throws Exception {
255         List<PerfCounter> counters = new ArrayList<>();
256         for (String name : counterNames) {
257             counters.add(PerfCounters.findByName(ns + "." + name));
258         }
259         return counters;
260     }
261 
262     private static Class<?> compileAndLoad(String name, String source) throws Exception {
263         byte[] byteCode = InMemoryJavaCompiler.compile(name, source);
264         return ByteCodeLoader.load(name, byteCode);
265     }
266 
267     private static boolean isUsingCompressedClassPointers() {
268         return Platform.is64bit();
269     }
270 
271     private static long getMinCapacity(String ns) throws Exception {
272         return PerfCounters.findByName(ns + ".minCapacity").longValue();
273     }
274 
275     private static long getCapacity(String ns) throws Exception {
276         return PerfCounters.findByName(ns + ".capacity").longValue();
277     }
278 
279     private static long getMaxCapacity(String ns) throws Exception {
280         return PerfCounters.findByName(ns + ".maxCapacity").longValue();
281     }
282 
283     private static long getUsed(String ns) throws Exception {
284         return PerfCounters.findByName(ns + ".used").longValue();
285     }
286 
287     private static long currentGCCount() {
288         long gcCount = 0;
< prev index next >